LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default waiting (or pausing) for user selections - nested loops vs. serialexecution

I've poked around the forum and not found a complete answer, so I
apologize if this is redundant or obvious.

What I'm trying to do is write a macro that will "copy" chart
properties (sizes, , fonts, axes scales, etc.) across charts. I was
planning to use a prototype chart as the source for these properties;
then as the user clicks on subsequent charts, each one gets the
properties of the prototype. When the user clicks on a cell, the
macro should end.

Thanks to Jon Peltier, I have created a chart events class that allows
trapping of events in embedded charts. I wrote code that sucessfully
changes global boolean variables if a chart is selected
(b_chart_select = true) or a cell is selected (b_cell_select = true).
What I'm stuck on, though, is how to "wait" for a user to click on
another chart.

It seems that user events (such as selecting a chart) are not detected
while code is running. Here's a snippet of code:

Do Until b_cell_select = True 'when this is true, user has clicked on
cell to end loop
While b_chart_select = True 'when this is true, the user has
clicked on a chart
'set chart properties
b_chart_select = False
DoEvents
Wend
DoEvents
Loop

However, while these loops are running, the chart_select and
selection_change events are not registered.

This makes me think that the correct approach would be to have some
stand-alone macros, such that when a chart is selected, a macro is
called. What confuses me here is how to pass chart properties from
the prototype to the newly selected chart. If the macros are stand-
alone, then any variables I have used to hold the prototype's
properties will not be available when the user clicks the next
(target) chart.

Any thoughts would be most appreciated!
Cheers,
JP
 
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
need help with nested for-next loops rpw Excel Programming 6 September 18th 07 04:38 PM
Pausing or waiting in VBA Brad Excel Programming 2 November 6th 06 05:07 PM
Pausing a macro while waiting for an input into a cell Francois Ashton[_2_] Excel Programming 3 July 19th 06 01:06 PM
Many Nested loops naterator Excel Programming 4 June 19th 06 10:43 PM
Nested loops?? CG Rosén Excel Programming 1 June 22nd 04 08:07 PM


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