Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing the Icon on a custom command Button

Status
Not open for further replies.

spgreen

Programmer
Aug 16, 2004
21
GB
Hi all,

As is says in the title how do you go about changing the default icon (smiley face) to another icon using vba. I've tried recording the action but nothing comes up.

thanks in advance

Simon
 
Hi ...

In the properties of you command button, you have a field "Picture". Choose your picture from it. Is it what you wanted ?

Rodie
 
thats what i want to do, but i want to change the picture using VBA not by doing it manually
 
Taken from the help files:
'Note: Be sure to refer to a bitmap file that is
'present on your system, and to include the path
'in the filename.
CommandButton1.Picture = _
LoadPicture("c:\windows\argyle.bmp")
CommandButton1.PicturePosition = ComboBox1.Value
End Sub
 
... Or, if you don't know the entire path of you picture, you can use this :
Code:
ThisWorkbook.Path & "\folder_name..."
Rodie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top