Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
various
I would like to end a job with some humor. Is it possible to randomly show
pictures or userforms when closing an userform? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
various
Mauro, try something like this:
Private Sub UserForm_initialize() Dim myMax%, myMin%, myImageNumber% Dim myImage$ myMax = 5 myMin = 1 myImageNumber = Round(Rnd * (myMax - myMin) * myMin + 1) myImage = "D:\macros\Images\" & _ Round(Rnd * (myMax - myMin) * myMin + 1) & ".gif" MsgBox myImage Image1.Picture = LoadPicture(myImage) End Sub Regards, Lonnie M. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
various
Mauro, Try this:
Private Sub UserForm_initialize() Dim myMax%, myMin%, myImageNumber% Dim myImage$ myMax = 5 myMin = 1 myImageNumber = Round(Rnd * (myMax - myMin) * myMin + 1) 'Be sure to change the directory to where your images are myImage = "D:\macros\Images\" & myImageNumber & ".gif" MsgBox myImage Image1.Picture = LoadPicture(myImage) End Sub Regards, Lonnie M. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
various
Mauro, Try this:
Private Sub UserForm_initialize() Dim myMax%, myMin%, myImageNumber% Dim myImage$ 'Use whatever min or max values you want myMax = 5 myMin = 1 myImageNumber = Round(Rnd * (myMax - myMin) * myMin + 1) 'Be sure to change the directory to where your images are myImage = "D:\macros\Images\" & myImageNumber & ".gif" Image1.Picture = LoadPicture(myImage) End Sub Regards, Lonnie M. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|