|
-
Jan 6th, 2005, 05:38 AM
#1
Thread Starter
Member
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
-
Jan 6th, 2005, 12:10 PM
#2
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
-
Jan 6th, 2005, 04:14 PM
#3
Thread Starter
Member
Re: Insert rows using a variable
is there someway to insert a row where the the active cell is?
Last edited by machinist; Jan 6th, 2005 at 04:16 PM.
Reason: mistypes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|