UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Activesheet.name When Following Hyperlink, Office 2013    
 
   
WildBird
post Jan 21 2020, 04:07 PM
Post#1


UtterAccess VIP
Posts: 3,724
Joined: 19-August 03
From: Auckland, Little Australia


Hi All,

I have 2 sheets, Main, and LocationData.

LocationData is hidden, and when I double click on a particular cell on Main, LocationData becomes visible and selected. This is what I want, and this works fine.

Issue I have is I have a hyperlink on LocationData that takes the user back to Main. This works, but I want to make LocationData hidden again.

Using this, it works, but I want to make it more generic, and not hardcode the name. If I use ActiveSheet.Name, it is picking up 'Main' (this code is on LocationData)
CODE
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
'Hide the sheet after going to the target sheet
ThisWorkbook.Worksheets("LocationData").Visible = xlHidden


I am sure I am missing some property that gets this value.

Cheers

--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 
WildBird
post Jan 21 2020, 04:13 PM
Post#2


UtterAccess VIP
Posts: 3,724
Joined: 19-August 03
From: Auckland, Little Australia


Got it! Caffeine kicked in :-)

me.name

CODE
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
'Hide the sheet after going to the target sheet
ThisWorkbook.Worksheets(Me.Name).Visible = xlHidden
End Sub



--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 
Debaser
post Jan 22 2020, 08:00 AM
Post#3



Posts: 179
Joined: 11-October 18



FWIW, you can just use:

CODE
Me.Visible = xlHidden
Go to the top of the page
 
WildBird
post Jan 29 2020, 05:15 PM
Post#4


UtterAccess VIP
Posts: 3,724
Joined: 19-August 03
From: Auckland, Little Australia


@Debaser - thanks, I just saw this!

Cheers

--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th February 2020 - 07:42 AM