BrianExcel
Well-known Member
- Joined
- Apr 21, 2010
- Messages
- 975
I have the following code which upon enablement is supposed to show an image file. There are about 8 different images, all set to invisible and on top of one another - so if you click the first radio button, the corresponding first image shows up. Clicking the second button brings up the second, and so on.
The problem is, when all are enabled I can't get the most recently selected to the top of the pile so it's visible. I tried the .setfocus command but it gives me an error that the control is either invisible, not enabled or not a control type that can accept the .setfocus.
Any suggestions?
The problem is, when all are enabled I can't get the most recently selected to the top of the pile so it's visible. I tried the .setfocus command but it gives me an error that the control is either invisible, not enabled or not a control type that can accept the .setfocus.
Any suggestions?
Code:
Sub StaplingUpperLeft()
If UserForm1.optStaplePortrait.Value = True Then
UserForm1.imgtest1.Visible = True
UserForm1.imgtest1.SetFocus
End If
If UserForm1.optStapleLandscape.Value = True Then
UserForm1.imgtest2.Visible = True
UserForm1.imgtest2.SetFocus
End If
End Sub