Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Activate hyperlink based on cell value


If Range("E5").Value = X Then


Where is X declared and assigned a value? If you don't declare it, VBA
will create a new variable named 'X' and assign it a value of 0. When
you clear out cell E5, it is treated as zero for numeric purposes, so
0 = X and thus triggers the link.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Thu, 9 Apr 2009 13:11:01 -0700, veggies27
wrote:

Mike,

One more try. For my spreadsheet, I converted the code to:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("E5").Value = X Then
Range("B5").Hyperlinks(1).Follow
End If
End Sub

However when I changed the "99" to an "X" it triggers the hyperlink when I
delete the X in the cell, not when I put the X in. Is that a text versus
numberic issue?


"Mike H" wrote:

Hi,

Similar solution

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value = 99 Then
Range("B1").Hyperlinks(1).Follow
End If
End Sub


Mike


"veggies27" wrote:

Mike,

Sorry for the vagueness.

The hyperlink is already in Sheet 1, B1. I want the input of a "99" in ceel
A1 to bring me to the place that the hyperlink in B1 is set to go.

Jeff

"veggies27" wrote:

I am trying to automatically activate a hyperlink if a certain cell has a
value in it. Is there a way this is possible?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using VBA to Activate a Hyperlink Matt Excel Programming 5 November 20th 08 04:56 PM
Hyperlink based on cell value in a different worksheet Bart Excel Worksheet Functions 3 October 24th 07 08:34 PM
hyperlink or bookmark based on cell value simonsmith Excel Discussion (Misc queries) 0 May 17th 06 07:09 PM
How do I de-activate hyperlink in Excel ? Nik New Users to Excel 2 November 18th 05 02:14 PM
Can Excel or Access activate a sound file based on a cell value? huzorba Excel Programming 2 November 2nd 05 12:26 AM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"