Insert rows using a variable
When you insert rows in excel you need to tell excel which row you can't just do
Rows.Insert Shift:= xlDown
so i made a variable called linenumber which keeps track of the row number but then i can't seem to make it insert a row by reffering to the variable
eg
Rows(linenumber).insert shift:= xldown
could someone help.plz
Re: Insert rows using a variable
Actually you can just insert a row by "Rows.Insert Shift:= xlDown" but this will just insert the row wherever the cursor happens to be at the moment !
What you need is to tell Excel where you won't to insert the row aswell
VB Code:
dim ARow as string
ARow = "6" ' Row Number here
Rows(ARow).Select ' Select the Row
Rows.Insert Shift:= xlDown ' Insert the Row
Re: Insert rows using a variable
is there someway to insert a row where the the active cell is?