Hi
I started working with VBA a couple months ago, so I'm not an expert still in my learning curve. Now, I'm trying to hide multiple columns from the multiple worksheets (same columns for all of them), based on the case condition where 1 = Jan, meaning that it will hide everything except Jan information, 2 = Feb with the same result only showing that particular information. I thougt I had it done...but I'm getting Run time error 1004 Application Defined or Object Defined. I already checked the spelling and also what I got about the syntax...but at least to me everything looks ok...and keep me point me to the line below
Set c = Sheets("Master Control").Range(B2)
See the code below to understand where it is showed up.
Thanks in advance for any help, as I've stuck for almost two days on this.
Sub Hide()
Dim SheetArray As Variant
Dim rng As Range, c As Range
Dim I As Integer
SheetArray = Array("KPI Report Total", "KPI Report 60", "KPI Report 67", "KPI Report 69" _
, "KPI Report 72", "KPI Report 75", "KPI Report 76")
Sheets("Master Control").Activate
For I = 0 To UBound(SheetArray)
Set rng = ActiveWorkbook.Worksheets(SheetArray(I)).Range("B:BW")
Set c = Sheets("Master Control").Range(B2)
Select Case c
Case "1"
Columns("H:BW").Select
Selection.EntireColumn.Hidden = True
End Select
Next I
Sheets("Master Control").Activate
End Sub
I started working with VBA a couple months ago, so I'm not an expert still in my learning curve. Now, I'm trying to hide multiple columns from the multiple worksheets (same columns for all of them), based on the case condition where 1 = Jan, meaning that it will hide everything except Jan information, 2 = Feb with the same result only showing that particular information. I thougt I had it done...but I'm getting Run time error 1004 Application Defined or Object Defined. I already checked the spelling and also what I got about the syntax...but at least to me everything looks ok...and keep me point me to the line below
Set c = Sheets("Master Control").Range(B2)
See the code below to understand where it is showed up.
Thanks in advance for any help, as I've stuck for almost two days on this.

Sub Hide()
Dim SheetArray As Variant
Dim rng As Range, c As Range
Dim I As Integer
SheetArray = Array("KPI Report Total", "KPI Report 60", "KPI Report 67", "KPI Report 69" _
, "KPI Report 72", "KPI Report 75", "KPI Report 76")
Sheets("Master Control").Activate
For I = 0 To UBound(SheetArray)
Set rng = ActiveWorkbook.Worksheets(SheetArray(I)).Range("B:BW")
Set c = Sheets("Master Control").Range(B2)
Select Case c
Case "1"
Columns("H:BW").Select
Selection.EntireColumn.Hidden = True
End Select
Next I
Sheets("Master Control").Activate
End Sub