I'm getting a:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets Select Case UCase(ws.Name) Case "Ark1", "Ark2" ws.Visible = True Case Else ws.Visible = xlSheetVeryHidden End Select Next ws End Sub
What am I doing wrong? Thanks for you help.Method 'Visible' of Object '_Worksheet' failed
Ron
Ron
Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad
Kindly
[1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
[2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
[3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated
hi,
see if it helps you
Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets Select Case (ws.Name) Case "Ark1", "Ark2" ws.Visible = True Case Else ws.Visible = xlSheetVeryHidden End Select Next ws
Regards, John
you're welcome! thx for rep!
If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.
Regards, John
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks