Avatar of R Davignon
R Davignon
Flag for United States of America asked on

Apply Format Settings From Worksheet to all other Sheets in Workbook

I have a worksheet in a workbook that is used as a baseline and has specific formatting.  Is there simple code in vba to read the formatting :Text size, column size, row size, fonts, print settings, etc  from my baseline sheet and apply it to all other worksheets in the workbook?
Microsoft ExcelVB Script

Avatar of undefined
Last Comment
Subodh Tiwari (Neeraj)

8/22/2022 - Mon
tel2

Hi robbdfw,

I don't know about the VBA option, but have you tried:
- Selecting the entire baseline sheet (i.e. click just to the left of the "A" header and above the "1" header).
- Click the format painter.
- Select the sheets you want to reformat (e.g. click the 1st sheet tab, hold down shift and click the last in the range).
- On the sheet that's now showing, again click just to the left of the "A" header and above the "1" header to apply that format to all selected sheets.
- Check the formats have changed on the required sheets.

Seems to work for me in Excel 2007 except I don't think it's copying print areas (if that's what you mean by "print settings" - is it?).
ASKER CERTIFIED SOLUTION
Subodh Tiwari (Neeraj)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Roy Cox

It's faster to simply select all the sheets rather than Loop through them. The active sheet would have it's formats overwritten but they would remain the same anyway. You can change ActiveSheet to a specific sheet e.g. Sheet1.Copy

Sub CopyFormat()


ActiveSheet.Cells.Copy

Worksheets.Select
Range("A1").PasteSpecial xlPasteFormats
Range("A1").PasteSpecial xlPasteColumnWidths
End Sub

Open in new window

R Davignon

ASKER
Thank you.  Great help as always.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Subodh Tiwari (Neeraj)

You're welcome. Glad to help.