Possible to have a formula to show "TRUE"/"FALSE" depending on sheet visibility?

povictory

New Member
Joined
May 28, 2015
Messages
41
Hello!

Is there a way to have an output in a cell show "True" or "False" depending on if another tab is visible or not visible? I'm looking to leverage that output for some other formulas/conditional formatting, but I only want to do that if another specific tab is visible and available to the user.

Any assistance is greatly appreciated!
 
There's another macro that unhides it when a hyperlink to the tab is clicked from another sheet. Apologies, but could you share how adding the additional line would look in the code?
Could you share that macro?
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Could you share that macro?
Sure! It is below:

VBA Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Dim desk As String
Dim shtname As String
Dim desk2 As String

  shtname = Left(Target.SubAddress, InStr(1, Target.SubAddress, "!") - 1)
  desk = Right(shtname, Len(shtname) - 1)
  desk2 = Left(desk, Len(desk) - 1)
  Sheets(desk2).Visible = True
  Sheets(desk2).Select

End Sub
 
Upvote 0
Assume output was in cell A1, sheet "Main"
PHP:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Dim desk As String
Dim shtname As String
Dim desk2 As String

  shtname = Left(Target.SubAddress, InStr(1, Target.SubAddress, "!") - 1)
  desk = Right(shtname, Len(shtname) - 1)
  desk2 = Left(desk, Len(desk) - 1)
  Sheets(desk2).Visible = True
' new added part: paste "desk2" visible statistic in to other sheet "Main"
  Sheets("Main").range("A1").value = "True"
'---------------
  Sheets(desk2).Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,884
Messages
6,127,560
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top