OK - So maybe I don't suck as bad as I thought... I figured out the form and
can now change the image size to any of my predetermined sizes by clicking
the image and then making a choice on the user form.
What I do still need help with is the following:
1) The ability for the code to know which image was clicked and enter the
appropriate "Picture Name" as a variable into the ActiveSheet.Shapes("Picture
Name").Select line.
2) Is there a better way of de-selecting the image than grabbing a cell,
like I'm doing now? I can't leave the image selected...
Thanks - You all don't suck! Far from it in fact...
Later-
Ray
Don't need to select the shape at all. Simply modify this to work
with your userform.
Sub Sizer(clickedShape As String, sz As String)
With ActiveSheet.Shapes(clickedShape)
MsgBox .Name
Select Case sz
Case "Larger"
.Height = 431.25
.Width = 356.25
Case "Large"
.Height = 279.75
.Width = 231#
Case "Minimize"
.Height = 86.25
.Width = 71.25
End Select
.LockAspectRatio = msoTrue
.Rotation = 0#
End With
End Sub
call like this:
Sub optionButton()
Sizer ActiveSheet.Shapes(Application.Caller).Name, "Minimize"
End Sub
> OK - So maybe I don't suck as bad as I thought... I figured out the form and
> can now change the image size to any of my predetermined sizes by clicking
[quoted text clipped - 72 lines]
> > Thanks.
> > Ray
JW - 25 Sep 2007 16:47 GMT
> Don't need to select the shape at all. Simply modify this to work
> with your userform.
[quoted text clipped - 98 lines]
> > > Thanks.
> > > Ray
OK. Modified it for you
In the code that calls the UserForm to open when clicking the shape,
add this before your UserForm.Show line:
callerName=ActiveSheet.Shapes(Application.Caller).Name
In a separate standard module, place this variable and sub:
Public callerName As String
Sub Sizer(clickedShape As String, sz As String)
With ActiveSheet.Shapes(clickedShape)
MsgBox .Name
Select Case sz
Case "Larger"
.Height = 431.25
.Width = 356.25
Case "Large"
.Height = 279.75
.Width = 231#
Case "Minimize"
.Height = 86.25
.Width = 71.25
End Select
.LockAspectRatio = msoTrue
.Rotation = 0#
End With
End Sub
In your UserForm, place this (assuming that your option buttons are
called optLarge, optLarger, and optMinimize).
Private Sub optLarge_Change()
optHandler
End Sub
Private Sub optLarger_Change()
optHandler
End Sub
Private Sub optMinimize_Change()
optHandler
End Sub
Sub optHandler()
If optLarge=True Then
Sizer callerName, "Large"
ElseIf optLarger=True then
Sizer callerName, "Larger"
ElseIf optMinimize=True Then
Sizer callerName, "Minimize"
End If
End Sub
RayportingMonkey - 25 Sep 2007 17:26 GMT
Hey JW-
Actually the first post you offered worked well for me and is a bit simpler.
The only real difference I made was to exclude the msg.box, as the user won't
care what the name of the image is called - the variable just needs to be
passed.
This is sweet - I actually now have what I would call my first real
dashboard - I have tons of small charts and graphs with the ability to "zoom
in" on any metric the user wants to see!
Later-
Ray
> > Don't need to select the shape at all. Simply modify this to work
> > with your userform.
[quoted text clipped - 151 lines]
> End If
> End Sub
JW - 25 Sep 2007 17:44 GMT
Glad to hear you got it sorted out Ray. Only reason I left the
message box in there was to give you a demonstration of what the
Application.Caller was doing.
Good luck in future projects.
> Hey JW-
>
[quoted text clipped - 165 lines]
> > End If
> > End Sub
RayportingMonkey - 25 Sep 2007 18:54 GMT
One other thing I had do to make this work effectively was to add the .ZOrder
msoBringToFront to the routine, because I may be "popping" images over other
images and I want the "magnified" image to be on top.
After playing with this a bit I have one minor and sporadic issue...
If I maximize an image and then minimize it, there are times that I am left
with what I would have to call a "ghost outline" of the larger image...
Scrolling the screen up and down or otherwise manipulating the cells seems to
"fix" this... It seems to be a screen refresh issue.
Is there a way to force a screen re-draw that might clear this up?
> Don't need to select the shape at all. Simply modify this to work
> with your userform.
[quoted text clipped - 97 lines]
> > > Thanks.
> > > Ray