russellhq
10-26-2007, 02:54 AM
Excel 2003. I've a worksheet with several images on it, with one main image.
When I click a command button, I want the main image to change to whatever image the command button is coded to. The following works when command button "Simple3" is clicked. The main image, "Image1" now looks like "Image4".
Private Sub Simple3_Click()
Image1.Picture = Image4.Picture
End Sub
My problem is, I want to expand the code so that the main image is changed based on a user input.
e.g.
Private Sub Stuck_Click()
MyImage = InputBox("image name?")
Image1.Picture = MyImage.Picture
End Sub
I've tried:
Private Sub Stuck_Click()
MyImage = InputBox("image name?")
Image1.Picture = Shapes(MyImage).Picture
End Sub
Does not work either.
I think there should be a simple solution, but being new to this I cannot find it :(
When I click a command button, I want the main image to change to whatever image the command button is coded to. The following works when command button "Simple3" is clicked. The main image, "Image1" now looks like "Image4".
Private Sub Simple3_Click()
Image1.Picture = Image4.Picture
End Sub
My problem is, I want to expand the code so that the main image is changed based on a user input.
e.g.
Private Sub Stuck_Click()
MyImage = InputBox("image name?")
Image1.Picture = MyImage.Picture
End Sub
I've tried:
Private Sub Stuck_Click()
MyImage = InputBox("image name?")
Image1.Picture = Shapes(MyImage).Picture
End Sub
Does not work either.
I think there should be a simple solution, but being new to this I cannot find it :(