Format Table

Xirom431

Board Regular
Joined
Dec 2, 2010
Messages
102
Hi,

I have 50 WS in a workbook. I would like to format Row 1 Column A to AI to Calibri Font size 8 and highlight yellow color of all WS. Also, how do I do that to every other row if needed? Thanks for the help.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi there,

Try:

Code:
Sub test()
    wsCount = Application.Sheets.Count
    For i = 1 To wsCount
        Sheets(i).Tab.ColorIndex = 6
        lRow = Sheets(i).Range("A1").End(xlDown).Row
        For j = 1 To lRow Step 2
            With Sheets(i).Range("A" & j & ":AI" & j).Font
                .Name = "Calibri"
                .Size = 8
            End With
        Next
    Next
End Sub

Edit: Forgot to add the tab colour change - I assume you mean set the tab colour to yellow?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

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