+ Reply to Thread
Results 1 to 11 of 11

add icon to a command button

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    add icon to a command button

    Hello,

    I created a userform and I would like to add a icon to a command button.

    Can anyone help me with that?

    Thanks

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: add icon to a command button

    Select the button, select the Picture property in the Properties window, then click the ellipsis button (...) and choose your picture.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: add icon to a command button

    That was the first thing i've tryed, but the picture filled in the intire button. what i need is the button to show the picture and the caption text.

    I think i know what's wrong. I'm selecting a bitmap picture when i should add an icon, but i don´t know how to add icons to the Excel 2007.

    Can you tell me if i'll have the problem whit adding a picture to a msgbox?

    Thank you

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: add icon to a command button

    You can't add a picture to a message box. Did you try altering the pictureposition property (next one down in the properties window)?

  5. #5
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: add icon to a command button

    I've solved half my problem. I've added an icon and it work great. But my excel 2007 doesn't have many icons and i don´t know how to insert more. But i'll keep trying until i learn how.

    About the icons in the msgbox, it's a little more complicated than that, isn't it?
    Is there any specified code to do it?

    Thanks

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: add icon to a command button

    Hello ncaravela,

    Are you asking if there is code to add an icon to message box command button? It would be far easier to create a custom UserForm.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: add icon to a command button

    I think you have a commandbutton on a userform. You can download free icons/bitmaps touse
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  8. #8
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: add icon to a command button

    Good Morning,

    My late question was not related with the userform but with the messagebox. I've created code so that when a txtbox is blank in the userform a msgbox appears with a message "please fill in all the fields"

    What i want to do is to add a icon to that msgbox.
    Here goes the code i've created:

    Please Login or Register  to view this content.
    I'm asking how can i add icon to this msgbox. Can you help me with that?

    Thanks

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: add icon to a command button

    The msgbox has 4 built-in icons of which you can select 1 using arguments.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: add icon to a command button

    If you want to add any other icons than the ones Andy mentioned, it would require a lot of complicated API code, and it would be far simpler to use a userform.

  11. #11
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: add icon to a command button

    That would do just fine.

    Thank you both.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1