Apply format to all sheets starting on the 4th sheet

ExcelNoob11

New Member
Joined
Jul 17, 2018
Messages
7
I have a template sheet called "template" that I'd like to apply to all sheets starting on the 4th. How do I loop through each sheet, apply the format and do some other functions. I posted a macro I create to do it manually. But it needs to dynamically take the value in A9, paste into the range b3:j3 and get rid of the first column.

Code:
    Sheets("Template").Select    Rows("1:8").Select
    Selection.Copy
   
 'loop to go through worksheets commented out
   ' For I = 4 To (Worksheets.Count())
   '     
   'Next
    
    Sheets("SheetAlpha").Select
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown
    Rows("9:9").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlUp
    Range("A9").Select
    ActiveCell.FormulaR1C1 = "Value1"
    Range("B3:J3").Select
    ActiveCell.FormulaR1C1 = "Value1"
    Range("A9").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Delete Shift:=xlToLeft
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Was able to successfully do what I wanted to do with this:
Code:
    Dim Person As String    Person = InputBox("Enter your name: FirstName_LastName")
    Application.ScreenUpdating = False
   For I = 4 To (Worksheets.Count())
    Sheets("Template").Select
    Rows("1:8").Select
    Selection.Copy
    ThisWorkbook.Sheets(I).Select
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown
    Rows("9:9").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlUp
    Range("A9").Copy Destination:=Range("B3:J3")
    Range("B5:J5").Value = Person
    Range("A9").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Delete Shift:=xlToLeft
    Cells.Select
    Cells.EntireColumn.AutoFit
    Range("B5:J5").Select
   Next
    Application.ScreenUpdating = True
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,986
Members
449,058
Latest member
oculus

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