Home > Software engineering >  Click on the button random EXCEL vba picture image
Click on the button random EXCEL vba picture image

Time:09-23

In excel, want to click on the button, and then determine whether a cell k5=10.00, the random popup images, but only a pop-up, won't pop up the second, how to modify, trouble warrior

Private Sub CommandButton1_Click ()
If Round (Range (" K5 "). The Value, 2)=10.00 Then
Image1. Visible=True Or Image2. Visible=True
End the if
End sub

CodePudding user response:

 Private Sub CommandButton1_Click () 
If Round (Range (" K5 "). The Value, 2)=10.00 Then
Dim as integer I
I=int (RND * 10)
Image1. Visible=(i>
=5)Image2. Visible=not image1. Visible
End the if
End sub
  •  Tags:  
  • VBA
  • Related