I have the following code that creates a new worksheet for each store in a range and copies data into each sheet. Everything works ok except I loose all my page setup I have on the master sheet. I brainlocking on what to change to copy the whole sheet, formating and all.
Public Sub StoreData()
Dim c As Range
Dim ws As Worksheet
Dim strWrkName As String
For Each c In Range("StoreList"
If WksExists(c.Value) = False Then
Set ws = Sheets.Add
ws.Name = c.Value
ws.Move After:=Sheets(Sheets.Count)
End If
strWrkName = c.Value
Worksheets("FOR"
.Range("A1:H62"
.Copy _
Destination:=Worksheets(strWrkName).Range("A1"
Sheets(strWrkName).Range("B3"
.Value = c.Value
Next
MsgBox "Missing Store Sheets have Been Created and Data Updated"
End Sub
Function WksExists(wksName As String) As Boolean
On Error Resume Next
WksExists = CBool(Len(Worksheets(wksName).Name) > 0)
End Function
Public Sub StoreData()
Dim c As Range
Dim ws As Worksheet
Dim strWrkName As String
For Each c In Range("StoreList"
If WksExists(c.Value) = False Then
Set ws = Sheets.Add
ws.Name = c.Value
ws.Move After:=Sheets(Sheets.Count)
End If
strWrkName = c.Value
Worksheets("FOR"
Destination:=Worksheets(strWrkName).Range("A1"
Sheets(strWrkName).Range("B3"
Next
MsgBox "Missing Store Sheets have Been Created and Data Updated"
End Sub
Function WksExists(wksName As String) As Boolean
On Error Resume Next
WksExists = CBool(Len(Worksheets(wksName).Name) > 0)
End Function