ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Userform Picture Change (https://www.excelbanter.com/excel-programming/344806-auto-userform-picture-change.html)

Shake

Auto Userform Picture Change
 

I have created a userform for entering my address details.

What i would like is the picture on the userform to be different each
time i open up the programme. I can not find the Excel VBA macro code
to do this.

Is it also possible to make it so that it can open on any machine?


--
Shake
------------------------------------------------------------------------
Shake's Profile: http://www.excelforum.com/member.php...o&userid=28577
View this thread: http://www.excelforum.com/showthread...hreadid=482414


Leith Ross[_225_]

Auto Userform Picture Change
 

Hello Shake,

The following code will load a picture of your choice as the background
for the user form. I have never seen any documentation on this function.
So, I am not suprised you haven't found any. You can set PicPath to the
picture you want. I just used what came loaded onto my machine (Office
2000).

*Load a Picture as the Object Background:* 'Change Picture

Code:
--------------------

PicPath = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg"
UserForm1.Picture = StdFunctions.LoadPicture(PicPath)

--------------------

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=482414


Shake[_2_]

Auto Userform Picture Change
 

Thanks for that! That works fine

I'll try toadapt it so that i can open differant pictures with maybe a
random number routine, say between 1 and 10. So that i can get files
that are named i.e. 1.jpg, 3.jpg


--
Shake
------------------------------------------------------------------------
Shake's Profile: http://www.excelforum.com/member.php...o&userid=28577
View this thread: http://www.excelforum.com/showthread...hreadid=482414



All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com