Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
MACRO ADD ROW
I am trying to figure out how to create a macro that will add a row in the
proper place everytime. For ex. I have rows with months inputted. Every month i would like to insert a row after the last month(A20) on the sheet and insert the "next month"(A21) and then input data across the inserted row. The problem then becomes the next month if I run the macro it will insert in a new row after A20 when I need the row inserted after A21. Is there a way for excel to know to go to the last Month in the row and insert a row. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
MACRO ADD ROW
You can use something like LastRow = Cells(65536,1).end(xlup).row to determine the last row on your worksheet and then add your new row below this An alternative is to do something like Cells(65536,1).end(xlup).offset(1,0) = NewMonth -- mrice Research Scientist with many years of spreadsheet development experience ------------------------------------------------------------------------ mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931 View this thread: http://www.excelforum.com/showthread...hreadid=545955 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |