Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jd jd is offline
external usenet poster
 
Posts: 91
Default AutoRun Excel Macros

Is there any way to automatically run a macro in excel based on the value of
a cell in that workbook? i.e. the value changes from 0 to 1 = run macro.
Anyone have a copy of code that does this? Using VBA and don't have full
blown VB - thanks!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default AutoRun Excel Macros

Hi JD

You can use the change event
http://www.cpearson.com/excel/events.htm

Here is a example of the change event that run a macro
http://www.rondebruin.nl/mail/change.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



--
Regards Ron de Bruin
http://www.rondebruin.nl



"JD" wrote in message ...
Is there any way to automatically run a macro in excel based on the value of
a cell in that workbook? i.e. the value changes from 0 to 1 = run macro.
Anyone have a copy of code that does this? Using VBA and don't have full
blown VB - thanks!!!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default AutoRun Excel Macros

How is the value going to change?

If by editing manually, can we assume that if the cell is edited, the macro
should run. (if it had a value of 2 and it still had a value of 2 after
editing, should the macro run?).

--
Regards,
Tom Ogilvy

"JD" wrote in message
...
Is there any way to automatically run a macro in excel based on the value

of
a cell in that workbook? i.e. the value changes from 0 to 1 = run macro.
Anyone have a copy of code that does this? Using VBA and don't have full
blown VB - thanks!!!!



  #4   Report Post  
Posted to microsoft.public.excel.programming
jd jd is offline
external usenet poster
 
Posts: 91
Default AutoRun Excel Macros

Tom,
Thanks for the reply. The value is updated every second using the built in
database query tools. The database is MS SQL - if that has any bearing.
Basically this discrete value is originates in a controller for a production
line and should drive a macro that pulls in data from three different
databases and then prints a report. All automatic - thus the dilemma. The
macro and database connectivity all works and I can manually run the macro to
generate the report and print - just need this last piece. Any ideas?

"Tom Ogilvy" wrote:

How is the value going to change?

If by editing manually, can we assume that if the cell is edited, the macro
should run. (if it had a value of 2 and it still had a value of 2 after
editing, should the macro run?).

--
Regards,
Tom Ogilvy

"JD" wrote in message
...
Is there any way to automatically run a macro in excel based on the value

of
a cell in that workbook? i.e. the value changes from 0 to 1 = run macro.
Anyone have a copy of code that does this? Using VBA and don't have full
blown VB - thanks!!!!




  #5   Report Post  
Posted to microsoft.public.excel.programming
jd jd is offline
external usenet poster
 
Posts: 91
Default AutoRun Excel Macros

Ron,
You're a genius!!!!! Works like a charm - I'll test it out on the full
production system in the morning, but, no doubt will work fine. Many
thanks!!!

"Ron de Bruin" wrote:

Hi JD

You can use the change event
http://www.cpearson.com/excel/events.htm

Here is a example of the change event that run a macro
http://www.rondebruin.nl/mail/change.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



--
Regards Ron de Bruin
http://www.rondebruin.nl



"JD" wrote in message ...
Is there any way to automatically run a macro in excel based on the value of
a cell in that workbook? i.e. the value changes from 0 to 1 = run macro.
Anyone have a copy of code that does this? Using VBA and don't have full
blown VB - thanks!!!!






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default AutoRun Excel Macros

I set up msquery to update every minute from an Access database and this
fired the change event. It is unclear what is updating every second - the
MS SQL database or Excel. If it is Excel, then you could use the change
event as Ron has pointed out. I doubt you need to print something every
second, particularly if you are updating from 3 different databases, but
perhaps you can cobble something together from the change event.
(retrieving data and printing a report would probably take longer than a
second, so you might have to lengthen you time between queries. )

for an overview of Events, see Chip Pearson's site:

http://www.cpeason.com/excel/events.htm

--
Regards,
Tom Ogilvy

"JD" wrote in message
...
Tom,
Thanks for the reply. The value is updated every second using the built

in
database query tools. The database is MS SQL - if that has any bearing.
Basically this discrete value is originates in a controller for a

production
line and should drive a macro that pulls in data from three different
databases and then prints a report. All automatic - thus the dilemma.

The
macro and database connectivity all works and I can manually run the macro

to
generate the report and print - just need this last piece. Any ideas?

"Tom Ogilvy" wrote:

How is the value going to change?

If by editing manually, can we assume that if the cell is edited, the

macro
should run. (if it had a value of 2 and it still had a value of 2 after
editing, should the macro run?).

--
Regards,
Tom Ogilvy

"JD" wrote in message
...
Is there any way to automatically run a macro in excel based on the

value
of
a cell in that workbook? i.e. the value changes from 0 to 1 = run

macro.
Anyone have a copy of code that does this? Using VBA and don't have

full
blown VB - thanks!!!!






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
Autorun macro Josh Excel Discussion (Misc queries) 2 August 16th 09 02:19 PM
Autorun macro Kelly Excel Worksheet Functions 1 January 18th 06 04:03 PM
Autorun Add-In A.M Excel Programming 2 September 21st 04 04:19 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM
AutoRun an Excel Workbook when CD-ROM is inserted; Help! Penny[_4_] Excel Programming 0 May 24th 04 06:17 PM


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