View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bishop Bishop is offline
external usenet poster
 
Posts: 208
Default Macros in Excel 2003

I want to create a macro to perform the same task but I need it to
accommodate changes in data from spreadsheet to spreadsheet. For example,
say I have a spreadsheet that has data in the first 20 rows of column A. I
make a macro to find the first empty cell in column A which, in this case, is
A21 and then highlight all the rows above it. So rows 1 through 20 will be
highlighted. But let's say the next spreadsheet I run the macro in has data
in the first 50 rows of column A. Because I made the macro in the first
sheet the macro will find the first empty cell at A51 (which is right) but
then it highlights rows 1-20 just like in the first one. Surely, there's a
way to make a macro virtual, no? So no matter how many rows have data the
macro will find the first empty cell, whatever that is, and then highlight
all the rows above that. How can this be done?