Thank you for your response,
I decided to start afresh before I read your reply and now I can Change the
value of a cell throughout the grouped worksheets but I am experiencing the
same problem with custom page headers for a group of worksheets.
Here is the relevant code in the hope you can identify where I am going
wrong
Regards
................................................................................................
Private Sub CommandButton1_Click()
If ComboBox1.ListIndex = -1 Then Exit Sub
If ComboBox2.ListIndex = -1 Then Exit Sub
If TextBox2 = "" Then Exit Sub
Me.Hide
If ComboBox1.ListIndex = 0 Then 'Print All Outlets
Dim Arr() As String 'Create an Array
of all Outlet Sheets
Dim N As Long
With ThisWorkbook.Worksheets
ReDim Arr(3 To .Count)
For N = 3 To .Count
Arr(N) = .Item(N).Name
Next N
End With
Sheets(Arr).Select
If ComboBox2.ListIndex = 0 Then 'Print All Months
For m = 3 To 14
With ActiveSheet.PageSetup
.RightHeader = " " & Chr(10) & "&""Palladius, Bold
Italic""&14" & Sheets("variables").Cells(m, 2) & " " & TextBox2
End With
Sheets(Arr).PrintPreview
' Sheets(Arr).PrintOut
Next m
Else 'Print Selected Month
ActiveSheet.PageSetup.RightHeader = " " & Chr(10) &
"&""Palladius, Bold Italic""&14" & ComboBox2.Value & " " & TextBox2
Sheets(Arr).PrintPreview
' Sheets(Arr).PrintOut
End If
Sheets(1).Activate
Else 'Print selected
Outlet
With Sheets(ComboBox1.Value)
If ComboBox2.ListIndex = 0 Then 'Print All Months
For m = 3 To 5 '14
.PageSetup.RightHeader = " " & Chr(10) &
"&""Palladius, Bold Italic""&14" & Sheets("variables").Cells(m, 2) & " " &
TextBox2
.PrintPreview
' .PrintOut
Next m
Else 'Print Selected
Month
.PageSetup.RightHeader = " " & Chr(10) &
"&""Palladius, Bold Italic""&14" & ComboBox2.Value & " " & TextBox2
.PrintPreview
' .PrintOut
End If
End With
End If
Me.Show
End Sub
...........................................................