Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complete Selection of Rows

Status
Not open for further replies.

Anaya

Technical User
Oct 16, 2008
1
AT
Hi - I need help with my code - I don't know much abou VBA, but I use Macros in Excel with the help of "Record Macro".

I need to select a full range. When recording Macro it normally records the last row on that particular sheet. I've worked around the problem to replace that row with the last row in the sheet (65536) but it takes FOREVER to run. I am sure there is a better way of doing this? Can anyone help?

Thank you!
Anaya
------------------------------
Range("X2:AA2").Select
Selection.AutoFill Destination:=Range("X2:AA65536")
Range("X2:AA65536").Select
 
faq707-2112
faq707-2115

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
If you want your macro to run on existing data in your worksheet, use : SpecialCells(xlLastCell)

This line will delete all data recorded in your WS

Worksheets("WS").Range("A1", .Cells.SpecialCells(xlLastCell)).ClearContents
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top