ststern45
Well-known Member
- Joined
- Sep 17, 2005
- Messages
- 974
- Office Version
- 365
- 2010
- Platform
- Windows
Hi Everyone,
I have tried numerous attempts to insert a new blank cell range in existing worksheets but getting the incorrect result.
This is the line of code I'm currently trying:
Rows("20:174").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
The result inserts rows from 20 through 329
I also tried using the code below using the custom ranges 20 through 174:
aRng = A
eRng = E
Range G1 = 20
Range G2 = 174
Rows.Range(aRng & Range("G1").Value & ":" & eRng & Range("G2").Value).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
The result using this code also inserts rows from 20 through 329
Is there a reason the total rows inserted are from 20:329 instead of 20:174?
The aRng and eRng are in the worksheet labeled InsertRows.
There are a total of 155 worksheets which have existing data in each. The data begins on row 20 in all 155 worksheets.
Thank you in advance
I have tried numerous attempts to insert a new blank cell range in existing worksheets but getting the incorrect result.
This is the line of code I'm currently trying:
Rows("20:174").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
The result inserts rows from 20 through 329
I also tried using the code below using the custom ranges 20 through 174:
aRng = A
eRng = E
Range G1 = 20
Range G2 = 174
Rows.Range(aRng & Range("G1").Value & ":" & eRng & Range("G2").Value).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
The result using this code also inserts rows from 20 through 329
Is there a reason the total rows inserted are from 20:329 instead of 20:174?
The aRng and eRng are in the worksheet labeled InsertRows.
There are a total of 155 worksheets which have existing data in each. The data begins on row 20 in all 155 worksheets.
Thank you in advance