A
Andy Kveps
I am trying to build a function or Sub that will hide or unhide a
specific
sheet based on the information I pass in, as follows:
Sub HideSheet(SheetName as string)
Worksheet(SheetName).Visible = False
end sub
This executes without error, but does not hide the sheet.
A macro without the parameter passing works fine:
Sub HideSheetOne()
Worksheet("Sheet1").Visible = False
end sub
It is not really practical to write a hide routine for every sheet I
have as a single selection by the user will hide several sheets in a
many Sheet Workbook and a different selection may hide a different
subset of the sheets.
I was hoping to get a function that would be used in a cell like this:
= HideSheetList(C11, "Sheet1, Sheet3, Sheet45, Sheet46")
where C11 would be a user filled out cell (such as true or false, 1 or
0 ...)
A true (or 1) in C11 would hide the list of sheets given.
Doesnt seem like asking for to much...
Does it?
Any suggestions?
Thanks,
Andy Kveps
specific
sheet based on the information I pass in, as follows:
Sub HideSheet(SheetName as string)
Worksheet(SheetName).Visible = False
end sub
This executes without error, but does not hide the sheet.
A macro without the parameter passing works fine:
Sub HideSheetOne()
Worksheet("Sheet1").Visible = False
end sub
It is not really practical to write a hide routine for every sheet I
have as a single selection by the user will hide several sheets in a
many Sheet Workbook and a different selection may hide a different
subset of the sheets.
I was hoping to get a function that would be used in a cell like this:
= HideSheetList(C11, "Sheet1, Sheet3, Sheet45, Sheet46")
where C11 would be a user filled out cell (such as true or false, 1 or
0 ...)
A true (or 1) in C11 would hide the list of sheets given.
Doesnt seem like asking for to much...
Does it?
Any suggestions?
Thanks,
Andy Kveps