View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Billyruben Billyruben is offline
external usenet poster
 
Posts: 13
Default autofill variable lenght column w/ sequential numbers using VBA

Problem: Sort data contained in an area defined by X number of columns and Y
number of rows, then sort the data back to its orginal row order.

Normally: Before the initial sort, add an extra column and assign a unique
number to each row. Sort using this extra column will restore the original
row order.

I can record a macro and display the VBA code without a problem.

Question: Write the code identifying the last sort row when # of rows not
constant. eg: Selection.AutoFill Destination:=Range("F5:F??"),
Type:=xlFillDefault. I can count the # of rows, but how do I store that
number, then pass it to the Range requirements?