Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 210
Default Automatically Excuting a Macro in a different workbook ?

I saw how neat is your answer to dim way back in 12/27/2007 about the macros
above.
I wonder if you could help me solve my problem.

can you design a macro that serves as a sound & message alert in
Excel sheet?

It would have to be able to monitor the value in cell A1 (that comes in as a
feed from a DDE link - continous streaming). The alert would be activated
when the value on A1 matches the criteria in cell C1 and according to the
sign ( ,< or = ) on D1, e.g. A1 C1 or A1 < C1 or A1 = C1 or =< C1 etc...
When activated, the macro would speak up the value on C1 - say " the quote
is (value of C1) " - and would repeat 4 times the announcement and show a
message saying the same thing, until an OK button is hit.
Then all over again for one more alert but for a different cell to be
monitored, A2, to be matched with C2 according to the sign on D2 , all on the
same sheet as A1 etc..
The catch is that since the value is streaming continuously - say every
second, the alert will be activated continously every second ( independently
of the repetition).There would have to be a brake to make the alert stop when
A1 hits the value of C1 until it is reset by punching an OK button!
Much appreciate any help on that...
PAT


"Bob Phillips" wrote:

A bit cleaner

Sub Macro1()
Application.ScreenUpdating = False
With Cells(1, 1)
If .Value 0 And .Value < 4 Then

Workbooks.Open Filename:= _
"C:\Documents and Settings\D. Murphy\My Documents\Book2.xls"

Select Case .Value

Case 1: Application.Run "'Book2.xls'!Macro1"
Case 2: Application.Run "'Book2.xls'!Macro2"
Case 3: Application.Run "'Book2.xls'!Macro3"
End Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End If
End With
Application.ScreenUpdating = True
End Sub


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"dim" wrote in message
...
Woohoo! I have it! And its all the sweeter because I sorted it out before
anyone got back to me! :-D

Thanks very much Bob & Dave, I couldn't have got it thus far without your
help. I hope everyone had a happy Christmas or whatever other festival you
may celebrate. :-)

Bye for now. Thanks.

Here's what I used in case anyone reads this in futu

Sub Macro1()
'
' Macro1 Macro
'

'
ScreenUpdating = False
If (Cells(1, 1).Value) = 1 Then
Workbooks.Open Filename:= _
"C:\Documents and Settings\D. Murphy\My Documents\Book2.xls"
Application.Run "'Book2.xls'!Macro1"
ActiveWorkbook.Save
ActiveWorkbook.Close
ElseIf (Cells(1, 1).Value) = 2 Then
Workbooks.Open Filename:= _
"C:\Documents and Settings\D. Murphy\My Documents\Book2.xls"
Application.Run "'Book2.xls'!Macro2"
ActiveWorkbook.Save
ActiveWorkbook.Close
ElseIf (Cells(1, 1).Value) = 3 Then
Workbooks.Open Filename:= _
"C:\Documents and Settings\D. Murphy\My Documents\Book2.xls"
Application.Run "'Book2.xls'!Macro3"
ActiveWorkbook.Save
ActiveWorkbook.Close
End If
ScreenUpdating = True
End Sub




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
automatically run startup macro in new workbook GALJohnson Excel Programming 1 September 12th 06 02:32 AM
Run a macro automatically on workbook open tweacle Excel Worksheet Functions 2 February 25th 06 06:38 PM
Macro add worksheet to workbook automatically Davin Excel Discussion (Misc queries) 0 February 17th 06 05:36 PM
a macro that launches another workbook automatically mtjarrett Excel Programming 2 February 17th 05 04:28 PM
Excuting marco on entering data into a field pauluk[_5_] Excel Programming 2 February 27th 04 01:35 PM


All times are GMT +1. The time now is 12:49 PM.

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"