Hi all,
A Workbook consists of 8 sheets of which Sheet1 is used for collecting data.
The remaining 7 sheets all have the same layout. When hiding specific cells on sheet2 the same cells for the other 6 sheets should be hidden.
The following macro works for sheet2, enters the other sheets but does not change the cell formating.
Private Sub CheckBox1_Click()
‘
Dim shSheets As Sheets
Dim wks As Worksheet
Dim rng2 As Range
Set shSheets = Worksheets(Array(2, 3, 4, 5, 6, 7, 8))
For Each wks In shSheets
Set rng2 = Range(“F9,F10,F16,F17,F18,F19,F20,F21,F22,F23,F29,F30,F33,F34,F35,F36,F38,F39,F40”)
If Range(“F2”) = True Then
rng2.Select
Selection.NumberFormat = “;;;”
Else:
Selection.NumberFormat = “#,##0.000” ‘CUUBS
End If
wks.Range(“a1”).Value = 100
wks.Range(“a1”).Font.Bold = True
Next wks
End Sub
What am i doing wrong?
TIA
Joop