Hello!
I am trying to create an animation using the sleep function in vba.
In my userform, it is initialized that the visibility of the image (named Water1) I want to animate is set to false. (Water1.visible=false)
After a certain condition is met, I want it to become visible. I have a sheet full of moves, and their corresponding animation (example, Water1). I used vlookup:
Application.WorksheetFunction.VLookup(Attack1.Caption, Sheet2.Range("a1:b12"), 2, 0).Visible = True
and the
Application.WorksheetFunction.VLookup(Attack1.Caption, Sheet2.Range("a1:b12")
part returns the string "Water1", which is the name of the image.
When I run the program, the error "object required" appears.
How can I turn this string into the object (image) of the same name and set its properties (visible)?
Thank you very much! :D
Bookmarks