Macro apply 2nd Row format to entire row data in each worksheet of workbook

Vbalearner85

Board Regular
Joined
Jun 9, 2019
Messages
139
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I want to copy 2nd row format of each worksheet to entire data in same worksheet of the workbook

Please note:-

Data in each worksheet has similar format and same number of columns
Some columns have lesser data(rows) as compared to other columns
Columns data is continuous/no blanks
Column data ends at Column AE

Regards,
PK
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello,

does this work as expected?

VBA Code:
Sub copy_row_2_format()
    Application.ScreenUpdating = False
    For MY_SHEETS = 1 To ActiveWorkbook.Sheets.Count
        With Sheets(MY_SHEETS)
            .Rows(2).Copy
            .Rows("3:" & .Range("A" & Rows.Count).End(xlUp).Row).PasteSpecial (xlPasteFormats)
        End With
    Next MY_SHEETS
    Application.ScreenUpdating = True
    Application.CutCopyMode = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

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