Hi everyone
I'm working on a project and am stuck on how to express something in vba.
Here is the code that I'm trying to run to see if it will, first run and second, give me what I'm looking for.
What I'm trying to express is: if the value of sn is a worksheet name within the workbook then make that sheet visible otherwise don't show it.
When I run/debug the code it give me an object required error message on the following line
What am I doing wrong and how can I fix it.
I'm working on a project and am stuck on how to express something in vba.
Here is the code that I'm trying to run to see if it will, first run and second, give me what I'm looking for.
What I'm trying to express is: if the value of sn is a worksheet name within the workbook then make that sheet visible otherwise don't show it.
Code:
For Each sn In ua
If sn.Value = Worksheet.Name Then
Worksheet.Visible = True
Else: Worksheet.Visible = False
Code:
If sn.Value = Worksheet.Name Then