In a workbook I have, I would like ALL sheets, except the sheet being used, to be hidden at all times.
In the 'ThisWorkbook' Object I have applied this code:
On multiple sheets within my workbook, I am able to double-click values in the A Column and the values being double-clicked, populate the C column in my main sheet/form in a sheet called "JE". Right now, when I try to double-click on those values in the A column, the message i get it, "Method 'Visible' of object '_Worksheet' failed" and the "...If MySh.Name <> Sh.Name Then MySh.Visible = 0" is highlighted as the issue.
When I double-click on a value in a separate sheet that is meant to populate the main sheet as well as navigate back to the main sheet, it does populate the C column of the main sheet (JE) however, it does not navigate back the main sheet as I would like. That is the main issue.
Does anyone know of a modification I can make to this code to keep ALL of the sheets except the active sheet, hidden, and still allow me to double-click values and have those values populate the C column of my main sheet (JE) as I normally did?
Thanks in advance!
In the 'ThisWorkbook' Object I have applied this code:
Code:
Option Explicit
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim MySh As Worksheet
For Each MySh In ThisWorkbook.Worksheets
If MySh.Name <> Sh.Name Then MySh.Visible = 0
Next MySh
End Sub
On multiple sheets within my workbook, I am able to double-click values in the A Column and the values being double-clicked, populate the C column in my main sheet/form in a sheet called "JE". Right now, when I try to double-click on those values in the A column, the message i get it, "Method 'Visible' of object '_Worksheet' failed" and the "...If MySh.Name <> Sh.Name Then MySh.Visible = 0" is highlighted as the issue.
When I double-click on a value in a separate sheet that is meant to populate the main sheet as well as navigate back to the main sheet, it does populate the C column of the main sheet (JE) however, it does not navigate back the main sheet as I would like. That is the main issue.
Does anyone know of a modification I can make to this code to keep ALL of the sheets except the active sheet, hidden, and still allow me to double-click values and have those values populate the C column of my main sheet (JE) as I normally did?
Thanks in advance!
Last edited: