Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default sheet event wait for another event?

I have an "in local workbook" hyperlink on sheet "employee roster". The roster's hyperlink event fires when a selection is made. It writes a cell value on the hyperlink's destination sheet, "employee report"

In the employee report sheet activate event I read that value written by the
roster's hyperlink event. Problem is activate event goes first.

Is there a way to sleep the activate event, and wait for the hyperlink event to finish?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default sheet event wait for another event?


Is there a way to sleep the activate event, and wait for the hyperlink event to finish?


I tried this and .. no go

Dim newHour As Variant: newHour = Hour(Now())
Dim newMinute As Variant: newMinute = Minute(Now())
Dim newSecond As Variant: newSecond = Second(Now()) + 5
Dim waitTime As Variant: waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default sheet event wait for another event?

I have an "in local workbook" hyperlink on sheet "employee roster".
The roster's hyperlink event fires when a selection is made. It
writes a cell value on the hyperlink's destination sheet, "employee
report"

In the employee report sheet activate event I read that value written
by the roster's hyperlink event. Problem is activate event goes
first.

Is there a way to sleep the activate event, and wait for the
hyperlink event to finish?


Why do you need to read the value in the _Activate event?

What happened with my suggestion to write the value to a defined name?
Then in the report sheet you can retrieve it in a cell via...

=CallerID

...so it automatically appears when the sheet is activated.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default sheet event wait for another event?

Optionally, if you require the caller on the roster sheet be written to
a specific cell on the report sheet...

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Report").Range("CallerID") = Target.Parent
End Sub

...which assumes the cell is named "CallerID", and it has local scope.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default sheet event wait for another event?

On Saturday, February 22, 2014 10:57:28 PM UTC-6, GS wrote:
Optionally, if you require the caller on the roster sheet be written to

a specific cell on the report sheet...



Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Sheets("Report").Range("CallerID") = Target.Parent

End Sub



..which assumes the cell is named "CallerID", and it has local scope.



--

Garry

I did write information. I did this on the sheet containing the hyperlink cell:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Dim oWs As Worksheet: set oWs = openWorksheetByCodeName(SHEET_IT_OWNER)
oWs.Range("from_hyper_link").Value = Target.Name

Set oWs = Nothing

End Sub

Not the same info but same idea. Since event management doesn't look like a good idea I'll try writing the report from the followhyperlink event itself.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default sheet event wait for another event?

That worked. The report can be written from the hyperlink caller's event.

I tried leaving information on the caller and target sheets for the report's activate event to read and work with. Neither worked. The information just isn't ready until the activate event is done.

Thank you for your help.
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default sheet event wait for another event?

That worked. The report can be written from the hyperlink caller's
event.

I tried leaving information on the caller and target sheets for the
report's activate event to read and work with. Neither worked. The
information just isn't ready until the activate event is done.

Thank you for your help.


Glad you got it working! Glad to be some help toward that end...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
apply cell change event to single column - WorksheetChange Event [email protected] Excel Programming 6 May 4th 08 02:28 AM
Click event on menu item is lost after first time firing of the event [email protected] Excel Programming 1 April 2nd 07 01:25 PM
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
How to trap delete row event and hide column event? Alan Excel Programming 3 April 26th 05 04:25 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


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