Swanson1962
New Member
- Joined
- Jan 1, 2010
- Messages
- 17
Hi (again) --
I have an Excel 2007 worksheet that has over 200 tabs. Each tab has 8 header tabs - I'm deleting rows 1 through 6 but for rows 7 and 8 I need to concatenate them together to create a NEW header row -- and then plan to delete them afterwards...
So I can get the first 6 rows to delete, (which means rows 7 and 8 are now rows 1 and 2), and miraculously the code works for cell A3 but not for the whole row (3:3) which is what I need.
Can anyone give me a hand in this??? Thanks so much!
Sub FormulaR1C11()
' Concatenate rows 1 and 2 into row 3
Sheets.Select
Range("3:3").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(R[-2]C,R[-1]C)"
Rows("3:3").Select
With ActiveCell.EntireRow
.Copy
Range("A3").Select
.PasteSpecial
End With
End Sub
I have an Excel 2007 worksheet that has over 200 tabs. Each tab has 8 header tabs - I'm deleting rows 1 through 6 but for rows 7 and 8 I need to concatenate them together to create a NEW header row -- and then plan to delete them afterwards...
So I can get the first 6 rows to delete, (which means rows 7 and 8 are now rows 1 and 2), and miraculously the code works for cell A3 but not for the whole row (3:3) which is what I need.
Can anyone give me a hand in this??? Thanks so much!
Sub FormulaR1C11()
' Concatenate rows 1 and 2 into row 3
Sheets.Select
Range("3:3").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(R[-2]C,R[-1]C)"
Rows("3:3").Select
With ActiveCell.EntireRow
.Copy
Range("A3").Select
.PasteSpecial
End With
End Sub