GreenyMcDuff
Active Member
- Joined
- Sep 20, 2010
- Messages
- 313
Hey guys,
I have a Workbook with 5 worksheets. Lets call them "Sheet 1", "Sheet 2", "Sheet 3", "Sheet 4" and "Sheet 5"
I need my macro to perform an initial check and set certain variables to False if those sheets are not there.
This is what I have so Far:
Unsurprisingly I get an unsuported property or method error.
I would grateful for your input as to how best solve this problem.
Kind Regards
Chris
I have a Workbook with 5 worksheets. Lets call them "Sheet 1", "Sheet 2", "Sheet 3", "Sheet 4" and "Sheet 5"
I need my macro to perform an initial check and set certain variables to False if those sheets are not there.
This is what I have so Far:
Code:
Option Explicit
Public ws_F As Boolean, ws_FI As Boolean, ws_NFI As Boolean, ws_O As Boolean, ws_X As Boolean
Sub sheet_format()
If Sheets("Sheet 1").Value = True Then ws_FI = True Else ws_FI = False
If Sheets("Sheet 2").Value = True Then ws_NFI = True Else ws_NFI = False
If Sheets("Sheet 3").Value = True Then ws_F = True Else ws_F = False
If Sheets("Sheet 4").Value = True Then ws_O = True Else ws_O = False
If Sheets("Sheet 5").Value = True Then ws_X = True Else ws_X = False
End Sub
Unsurprisingly I get an unsuported property or method error.
I would grateful for your input as to how best solve this problem.
Kind Regards
Chris