VBA to select all sheets after number 5 to end of workbook then Paste format

Kimpnc

New Member
Joined
Aug 17, 2015
Messages
13
I currently use an array of named sheets but sometimes other names may be present and then on others occasions not all these will be there.
how do I change

Sheets(Array("WORK", "WOLV", "WENT", "WEB", "STKE", "SHEF", "SCUN", "SAX", "SAW", _
"ROTC", "LICH", "LEED", "IPS", "HULL", "HIT", "GATE", "CHET", "BROU", "BRAD", _
"BARN", "AZON", "A1")).Select
Sheets("WORK").Activate
Range("Q1").Select

With something which will count the number of sheets After sheet 5 [first 5 sheets are one with the formatting to be pasted to these named sheets and 4 with calculations] and then apply the formulas and formats from the first sheet.

There are 3 different functions/ formatting types on each sheet so I run this 3 times within the VBA to produce the monthly balance sheet.

Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Not sure what you are doing, but if you want to create a loop for all the sheets after sheet 5 Then
Code:
Dim i As Long
For i = 6 To ThisWorkbook.Sheets.Count
    With Sheets(i)
    'Do your stuff here, use the period in front of Rows, Columns, Range and Cells to connect the statement to the parent sheet
    End With
Next
This will increment from sheet 6 onward through the last sheet.
 
Upvote 0

Forum statistics

Threads
1,215,756
Messages
6,126,692
Members
449,330
Latest member
ThatGuyCap

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