ActiveCell.FormulaR1C1 to copy/paste in a whole row in whole worksheet

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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,224,518
Messages
6,179,256
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top