Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The macro below allows the user to insert 8 rows on a diary card type form
when needed, using the last blank row on the form. The macro is intended to be run over and over, however, unless I make the references variable, the rows will be inserted in the middle of data entry. I don't know how to make the last row and the inserted rows always occur at the end of the entries. I can't count the rows to determine the end because I have other entries in rows below, representing the next page of the form. Any help is appreciated. Sub Insertrows1() ActiveSheet.Unprotect Range("A23").Select Selection.End(xlDown).Select Selection.End(xlDown).Select Rows("45:45").Select<-------------------- I want this to be one up from end down, end down, which will be last row of the form. Selection.Copy Rows("46:54").Select<---------------------- I want this to be 8 rows after the last row Selection.Insert Shift:=xlDown Range("A46").Select Selection.End(xlDown).Select Range("A54").Select<---------- I want to return the user to the last row, before the insertion of new rows. ActiveSheet.Protect End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting specific points on a graph and label them? | Charts and Charting in Excel | |||
Inserting Variable Number of Rows | Excel Programming | |||
variable cell referencing for simple data points | Excel Programming | |||
Inserting a variable number of rows in a worksheet | Excel Programming | |||
inserting a variable into VB | Excel Programming |