Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Running code when hyperlink clicked

Hello,

I am definitely baffled. I am trying to run code when a hyperlink is
clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet
1 using "=hyperlink()", the hyperlink is to a video clip, and events are
definitely enabled. I had tried two things, either of which would be fine:

1. I put the following code in Sheet1, and it did not respond at all. What
am I doing wrong?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

2. I put the following code in Sheet1, and it does run. The only issue is
that I would like to be able to terminate the hyperlink before the video pops
up. Any thoughts?

Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Column = 2 Then
Sheets("Sheet1").Range("B1") = "It Ran"
'Want to terminate hyperlink here. How to do?
End If

End Sub

Any help in understanding either one of these would be greatly appreciated.
Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Running code when hyperlink clicked

Use an Inserted hyperlink, not the worksheet function.
--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Hello,

I am definitely baffled. I am trying to run code when a hyperlink is
clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet
1 using "=hyperlink()", the hyperlink is to a video clip, and events are
definitely enabled. I had tried two things, either of which would be fine:

1. I put the following code in Sheet1, and it did not respond at all. What
am I doing wrong?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

2. I put the following code in Sheet1, and it does run. The only issue is
that I would like to be able to terminate the hyperlink before the video pops
up. Any thoughts?

Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Column = 2 Then
Sheets("Sheet1").Range("B1") = "It Ran"
'Want to terminate hyperlink here. How to do?
End If

End Sub

Any help in understanding either one of these would be greatly appreciated.
Thank you in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Running code when hyperlink clicked

Fantastic. That piece of information is exactly what I needed. My next
issue is how to make the hyperlink show the "path" when scrolled over, but
not actually run unless I decide based on some parameters that it should be
run. Again, any assistance is greatly appreciated.

"Gary''s Student" wrote:

Use an Inserted hyperlink, not the worksheet function.
--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Hello,

I am definitely baffled. I am trying to run code when a hyperlink is
clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet
1 using "=hyperlink()", the hyperlink is to a video clip, and events are
definitely enabled. I had tried two things, either of which would be fine:

1. I put the following code in Sheet1, and it did not respond at all. What
am I doing wrong?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

2. I put the following code in Sheet1, and it does run. The only issue is
that I would like to be able to terminate the hyperlink before the video pops
up. Any thoughts?

Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Column = 2 Then
Sheets("Sheet1").Range("B1") = "It Ran"
'Want to terminate hyperlink here. How to do?
End If

End Sub

Any help in understanding either one of these would be greatly appreciated.
Thank you in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Running code when hyperlink clicked

Can you define what the differences are?
--
Regards

Rick


"Gary''s Student" wrote:

Use an Inserted hyperlink, not the worksheet function.
--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Hello,

I am definitely baffled. I am trying to run code when a hyperlink is
clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet
1 using "=hyperlink()", the hyperlink is to a video clip, and events are
definitely enabled. I had tried two things, either of which would be fine:

1. I put the following code in Sheet1, and it did not respond at all. What
am I doing wrong?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

2. I put the following code in Sheet1, and it does run. The only issue is
that I would like to be able to terminate the hyperlink before the video pops
up. Any thoughts?

Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Column = 2 Then
Sheets("Sheet1").Range("B1") = "It Ran"
'Want to terminate hyperlink here. How to do?
End If

End Sub

Any help in understanding either one of these would be greatly appreciated.
Thank you in advance.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Running code when hyperlink clicked

Well, the dialog box for Insert Hyperlink does allow a screentip to be added.
Perhaps the screentip can be set programmatically.

Let me know how you make out.


--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Fantastic. That piece of information is exactly what I needed. My next
issue is how to make the hyperlink show the "path" when scrolled over, but
not actually run unless I decide based on some parameters that it should be
run. Again, any assistance is greatly appreciated.

"Gary''s Student" wrote:

Use an Inserted hyperlink, not the worksheet function.
--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Hello,

I am definitely baffled. I am trying to run code when a hyperlink is
clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet
1 using "=hyperlink()", the hyperlink is to a video clip, and events are
definitely enabled. I had tried two things, either of which would be fine:

1. I put the following code in Sheet1, and it did not respond at all. What
am I doing wrong?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

2. I put the following code in Sheet1, and it does run. The only issue is
that I would like to be able to terminate the hyperlink before the video pops
up. Any thoughts?

Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Column = 2 Then
Sheets("Sheet1").Range("B1") = "It Ran"
'Want to terminate hyperlink here. How to do?
End If

End Sub

Any help in understanding either one of these would be greatly appreciated.
Thank you in advance.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Running code when hyperlink clicked

Rick,

In the case of video or audio files, I would want to process them
differently. Images, documents, etc could just run. Right now my thought is
that I would prevent the video and audio files from running, and then run the
files the way that I want them run.

I hope this helps.

"Rick S." wrote:

Can you define what the differences are?
--
Regards

Rick


"Gary''s Student" wrote:

Use an Inserted hyperlink, not the worksheet function.
--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Hello,

I am definitely baffled. I am trying to run code when a hyperlink is
clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet
1 using "=hyperlink()", the hyperlink is to a video clip, and events are
definitely enabled. I had tried two things, either of which would be fine:

1. I put the following code in Sheet1, and it did not respond at all. What
am I doing wrong?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

2. I put the following code in Sheet1, and it does run. The only issue is
that I would like to be able to terminate the hyperlink before the video pops
up. Any thoughts?

Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Column = 2 Then
Sheets("Sheet1").Range("B1") = "It Ran"
'Want to terminate hyperlink here. How to do?
End If

End Sub

Any help in understanding either one of these would be greatly appreciated.
Thank you in advance.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Running code when hyperlink clicked

That was amazingly easy. I used the line of code below and it gives me
exactly what I am looking for. Thank you for the nudge in the right
direction.

"Gary''s Student" wrote:

Well, the dialog box for Insert Hyperlink does allow a screentip to be added.
Perhaps the screentip can be set programmatically.

Let me know how you make out.


--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Fantastic. That piece of information is exactly what I needed. My next
issue is how to make the hyperlink show the "path" when scrolled over, but
not actually run unless I decide based on some parameters that it should be
run. Again, any assistance is greatly appreciated.

"Gary''s Student" wrote:

Use an Inserted hyperlink, not the worksheet function.
--
Gary''s Student - gsnu201001


"ZipCurs" wrote:

Hello,

I am definitely baffled. I am trying to run code when a hyperlink is
clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet
1 using "=hyperlink()", the hyperlink is to a video clip, and events are
definitely enabled. I had tried two things, either of which would be fine:

1. I put the following code in Sheet1, and it did not respond at all. What
am I doing wrong?

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

2. I put the following code in Sheet1, and it does run. The only issue is
that I would like to be able to terminate the hyperlink before the video pops
up. Any thoughts?

Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Column = 2 Then
Sheets("Sheet1").Range("B1") = "It Ran"
'Want to terminate hyperlink here. How to do?
End If

End Sub

Any help in understanding either one of these would be greatly appreciated.
Thank you in advance.

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
Executing Code When Cell Is Double Clicked. Stever Excel Programming 1 November 3rd 06 06:36 PM
Running code by clicking on a hyperlink cell matpj[_53_] Excel Programming 3 March 29th 06 02:27 PM
Code needed to test if user clicked a button Subs Excel Programming 2 September 26th 05 02:52 PM
Insert Data when hyperlink is clicked Chuck N Excel Discussion (Misc queries) 2 September 9th 05 05:12 PM
how to tell which hyperlink was clicked Paul James[_3_] Excel Programming 6 November 20th 03 10:51 PM


All times are GMT +1. The time now is 11:55 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"