View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
tlwhite tlwhite is offline
external usenet poster
 
Posts: 2
Default varying table length in a MACRO

I would like to perform a macro on multiple spreadsheets with varying numbers
of rows. When recording the macro, I used the keystrokes to go to the end of
the spreadsheet; however, when I apply the macro to other spreadsheets, it
uses a fixed row area. How can I get this to go to the end of the
spreadsheet?

tlwhite

Range("A2").Select
ActiveCell.SpecialCells(xlLastCell).Select
Range(Selection, Cells(1)).Select
Range("B1:M2028").Select
Range("M2028").Activate