View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy[_8_] Doug Glancy[_8_] is offline
external usenet poster
 
Posts: 63
Default Pause Until Mouseclick?

Ray,

I think the pausing idea is tough to execute, you'd have to use OnTime, I
think, and I always try to avoid using that if possible.

I think the code below will give you a start. It assumes you have 5 pics on
Sheet1, named "Picture 1", "Picture 2", etc.. It simply toggles each
clicked picture to be bigger or smaller. I've never actually used a static
variable, but I think it's what's needed he

Sub PicClick()
Static blnPicIsMagnified(1 To 5) As Boolean ' adjust for number of pics
Const MAGNIFICATION_FACTOR As Long = 5' adjust to change magnification

blnPicIsMagnified(Replace(Application.Caller, "Picture ", "")) = _
Not blnPicIsMagnified(Replace(Application.Caller, "Picture ", ""))
With Worksheets(1).Shapes(Application.Caller)
If blnPicIsMagnified(Replace(Application.Caller, "Picture ", "")) Then
.Height = .Height * MAGNIFICATION_FACTOR 'assumes aspect ratio is
locked, width will follow
Else
.Height = .Height / MAGNIFICATION_FACTOR
End If
End With
End Sub

hth,

Doug

"RayportingMonkey" wrote in
message ...
I am working on a reporting dashboard and have created a series of dynamic
charts & graphs with conditional Red/Yellow/Green backgrounds and used the
"camera" feature to capture images which I have reduced to 20% their
viewing
size.

I then located these "minimized" images on my dashboard and created a
macro,
which is associated with the image, so that when clicked the image gets
maximized or magnigfied for viewing purposes. This way, my directors can
see
a lot of data and only drill down on the metrics that are of interest to
them, as indicated by the color scheme.

Instead of creating two macros, I figured it would be far easier to
maximize, pause and then return the image to it's minimized state. I want
the
pause to last only until the user clicks their mouse again.

Here's the code I am using now:

Sub TempMag()
'Select the image and format picture scale to 100%
ActiveSheet.Shapes("Picture 53").Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 431.25
Selection.ShapeRange.Width = 356.25
Selection.ShapeRange.Rotation = 0#

'I need code here that simply pauses and waits
'for the user to click their mouse again...

'Return the image to it's 20% minimized position
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 86.25
Selection.ShapeRange.Width = 71.25
Selection.ShapeRange.Rotation = 0#
Cell(A1).Select
End Sub

As always, thanks!
Ray
Trying to make reporting so easy... a monkey could run them!