View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John Bundy John Bundy is offline
external usenet poster
 
Posts: 772
Default Need macro to start at a new line

lastRow = Sheets("sheetname").Cells(Rows.Count, "A").End(xlUp).Row
This will get you the last used row in column A, change as necessarry.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"MHenderson" wrote:

I am creating a macro that will add additional lines before my "Total" line
at the bottom of my worksheet. Sometimes I have to add additional items to
my order form and I need them included in the total.

I created the macro, but each time I run it, the macro inputs the new rows
at the cell where I originally set the macro to input rows. For example,
when I recorded the macro my total line was line 25. So, I went to line 24,
copied it and inserted the copied row. I set the macro to add 5 rows. When
I reach row 30 and I try to add 5 more rows using the macro, it runs by
starting back at row 24, instead of row 29.

Any suggestions...Thanks