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
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?).
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.CopyWorksheets.SelectRange("A1").PasteSpecial xlPasteFormatsRange("A1").PasteSpecial xlPasteColumnWidthsEnd Sub
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?).