Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Worksheet_SelectionChange

I am using the following macro to run whenever B2 is selected:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address < "$B$2" Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
MsgBox ("hi")
Application.EnableEvents = True
End Sub

The macro works just fine; click on B1 and the macro runs.

B1 contains a hyperlink. The click also causes the hyperlink to be followed
(simultaneously??).

Is there anyway I can force the macro to execute completely before the
hyperlink gets followed?
--
Gary's Student
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Worksheet_SelectionChange

Hello GS,
You could put a fake hyperlink in the cell.. blue colored font with an underline.
Then at the end of your Sub, you could add code to duplicate the hyperlink action,
maybe an Application.GoTo.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Gary''s Student"
wrote in message
...
I am using the following macro to run whenever B2 is selected:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address < "$B$2" Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
MsgBox ("hi")
Application.EnableEvents = True
End Sub

The macro works just fine; click on B1 and the macro runs.
B1 contains a hyperlink. The click also causes the hyperlink to be followed
(simultaneously??).
Is there anyway I can force the macro to execute completely before the
hyperlink gets followed?
--
Gary's Student
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Worksheet_SelectionChange

Actually, you could have a real hyperlink in the cell, just link it back
to itself... Cell B2 hyperlinked to Cell B2.
Jim Cone


"Jim Cone" wrote in message...
Hello GS,
You could put a fake hyperlink in the cell.. blue colored font with an underline.
Then at the end of your Sub, you could add code to duplicate the hyperlink action,
maybe an Application.GoTo.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Gary''s Student"
wrote in message
...
I am using the following macro to run whenever B2 is selected:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address < "$B$2" Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
MsgBox ("hi")
Application.EnableEvents = True
End Sub

The macro works just fine; click on B1 and the macro runs.
B1 contains a hyperlink. The click also causes the hyperlink to be followed
(simultaneously??).
Is there anyway I can force the macro to execute completely before the
hyperlink gets followed?
--
Gary's Student
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Worksheet_SelectionChange

Thank you Jim
--
Gary''s Student


"Jim Cone" wrote:

Actually, you could have a real hyperlink in the cell, just link it back
to itself... Cell B2 hyperlinked to Cell B2.
Jim Cone


"Jim Cone" wrote in message...
Hello GS,
You could put a fake hyperlink in the cell.. blue colored font with an underline.
Then at the end of your Sub, you could add code to duplicate the hyperlink action,
maybe an Application.GoTo.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Gary''s Student"
wrote in message
...
I am using the following macro to run whenever B2 is selected:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address < "$B$2" Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
MsgBox ("hi")
Application.EnableEvents = True
End Sub

The macro works just fine; click on B1 and the macro runs.
B1 contains a hyperlink. The click also causes the hyperlink to be followed
(simultaneously??).
Is there anyway I can force the macro to execute completely before the
hyperlink gets followed?
--
Gary's Student

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
Worksheet_Change or Worksheet_SelectionChange Bret Excel Programming 2 September 27th 05 12:55 AM
Worksheet_SelectionChange mangesh_yadav[_144_] Excel Programming 0 October 25th 04 12:56 PM
Worksheet_SelectionChange mangesh_yadav[_143_] Excel Programming 1 October 25th 04 11:49 AM
Worksheet_SelectionChange Rasmus[_2_] Excel Programming 2 June 27th 04 07:19 PM
Worksheet_SelectionChange Bill Oertell[_2_] Excel Programming 8 April 23rd 04 05:18 AM


All times are GMT +1. The time now is 01:32 AM.

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

About Us

"It's about Microsoft Excel"