ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy layout to all worksheets (https://www.excelbanter.com/excel-programming/313520-copy-layout-all-worksheets.html)

Jean-Paul De Winter

Copy layout to all worksheets
 
Hi
I have a workbook with 25 worksheets.
The first sheet is my "template "; all other are based upon this template
The question is:
Whe I chnage something on the template: layout/colour of a cell, columwith,
validation of a range of cells.... I want it to be changed in all sheets.
How can this be done?
Thanks



Peter T

Copy layout to all worksheets
 
This should copy formats, but not sure what you mean by "validation of a
range of cells".
Change "Sheet1" to your template name.

Sub Test()
Dim wsTpl As Worksheet, ws As Worksheet, r As Range
Set wsTpl = Worksheets("Sheet1") 'template
Application.ScreenUpdating = False
wsTpl.Cells.Copy
For Each ws In ActiveWorkbook.Worksheets
If Not ws Is wsTpl Then
ws.Activate 'only to enable r.Select later
Set r = ActiveCell
ws.Cells.PasteSpecial Paste:=xlFormats
r.Select 'to deselect whole sheet
End If
Next
wsTpl.Activate
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

Regards,
Peter

"Jean-Paul De Winter" wrote in message
...
Hi
I have a workbook with 25 worksheets.
The first sheet is my "template "; all other are based upon this template
The question is:
Whe I chnage something on the template: layout/colour of a cell,

columwith,
validation of a range of cells.... I want it to be changed in all sheets.
How can this be done?
Thanks





Tom Ogilvy

Copy layout to all worksheets
 
If you select all sheets (group the sheets) and make the change.

Make sure you ungroup before making changes not intended for all sheets.

--
Regards,
Tom Ogilvy

"Jean-Paul De Winter" wrote in message
...
Hi
I have a workbook with 25 worksheets.
The first sheet is my "template "; all other are based upon this template
The question is:
Whe I chnage something on the template: layout/colour of a cell,

columwith,
validation of a range of cells.... I want it to be changed in all sheets.
How can this be done?
Thanks





Jean-Paul De Winter

Copy layout to all worksheets
 
great help.... saves hours of time
Thanks
"Tom Ogilvy" schreef in bericht
...
If you select all sheets (group the sheets) and make the change.

Make sure you ungroup before making changes not intended for all sheets.

--
Regards,
Tom Ogilvy

"Jean-Paul De Winter" wrote in message
...
Hi
I have a workbook with 25 worksheets.
The first sheet is my "template "; all other are based upon this

template
The question is:
Whe I chnage something on the template: layout/colour of a cell,

columwith,
validation of a range of cells.... I want it to be changed in all

sheets.
How can this be done?
Thanks








All times are GMT +1. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com