A1floodtech
New Member
- Joined
- Oct 11, 2012
- Messages
- 2
Hello,
I need to do two things, can be two seperate macro's. 1. I need to insert a blank row every other row in a selected range. 2. Then I need to move the data from Column G into column B in the newly created rows.
The number of rows I have varies each month.
Sample is I have 80 rows of data, columns A-G.
I need to insert a row between each existing row.
Then I need to move what is in column G into column B on the newly inserted row.
I found a macro on microsoft to insert rows, but it ignores the selected range and inserts a row down the entire dataset.
Sub InsertRows()
Dim r As Long
Dim m As Long
Application.ScreenUpdating = False
m = Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For r = m To 2 Step -1
Cells(r, 1).EntireRow.Insert
Next r
Application.ScreenUpdating = True
End Sub
Thanks, Keith
I need to do two things, can be two seperate macro's. 1. I need to insert a blank row every other row in a selected range. 2. Then I need to move the data from Column G into column B in the newly created rows.
The number of rows I have varies each month.
Sample is I have 80 rows of data, columns A-G.
I need to insert a row between each existing row.
Then I need to move what is in column G into column B on the newly inserted row.
I found a macro on microsoft to insert rows, but it ignores the selected range and inserts a row down the entire dataset.
Sub InsertRows()
Dim r As Long
Dim m As Long
Application.ScreenUpdating = False
m = Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For r = m To 2 Step -1
Cells(r, 1).EntireRow.Insert
Next r
Application.ScreenUpdating = True
End Sub
Thanks, Keith