Excel 2007.
This is probably something simple, haven't gotten it though... Making a button on my ribbon that will fire a macro. All the macro needs to do is say, "if sheetX is visible, then hide... if sheetX is hidden, then visible = true"
Here's where I'm at:
MyArray as dimmed variant and it's just a list of sheet names.
Getting error on "If Sheets(MyArray(i)).Visible = True Then"
Any help very much appreciated.
This is probably something simple, haven't gotten it though... Making a button on my ribbon that will fire a macro. All the macro needs to do is say, "if sheetX is visible, then hide... if sheetX is hidden, then visible = true"
Here's where I'm at:
Code:
For i = LBound(MyArray) To UBound(MyArray)
If Sheets(MyArray(i)).Visible = True Then
Sheets(MyArray(i)).visibe = xlHidden
Else:
If Sheets(MyArray(i)).Visible = xlHidden Then
Sheets(MyArray(i)).Visible = True
End If
End If
Next i
MyArray as dimmed variant and it's just a list of sheet names.
Getting error on "If Sheets(MyArray(i)).Visible = True Then"
Any help very much appreciated.