+ Reply to Thread
Results 1 to 6 of 6

Icon in userform - do I have to copy code into every form?

  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    -
    MS-Off Ver
    -
    Posts
    68

    Icon in userform - do I have to copy code into every form?

    Hi guys,
    The following shows code (which I copied off the internets) to place an icon in my userform's caption
    Please Login or Register  to view this content.
    It works fine! However, I have quite a few userforms and didn't want to chunk up their code with repeated instances of the above. Is there an easier way to do this?
    Thanks!

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Icon in userform - do I have to copy code into every form?

    In a normal module:
    Please Login or Register  to view this content.
    then in the userforms:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    09-08-2014
    Location
    -
    MS-Off Ver
    -
    Posts
    68

    Re: Icon in userform - do I have to copy code into every form?

    Thanks romper! Worked perfectly.
    I do have a question though - why must multiple modules be created? For example, if I copy this into a module which I have my OpenFile code in, it comes up with the whole "Only comments may appear after end sub, end function..." etc.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Icon in userform - do I have to copy code into every form?

    You can use an existing module as long as you put this part above any existing routines:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-08-2014
    Location
    -
    MS-Off Ver
    -
    Posts
    68

    Re: Icon in userform - do I have to copy code into every form?

    Ah! That makes sense.
    Apparently I have to spread some reputation around before giving some to you again. Hmph. Clearly you deserve the lion's share of it XD
    Last edited by MarmaladeLover; 09-11-2014 at 10:44 AM.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Icon in userform - do I have to copy code into every form?

    Don't worry - a simple thanks is sufficient!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Is there a way to rewrite this code for a UserForm in loop form?
    By bananajelly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2014, 01:21 PM
  2. [SOLVED] Simple UserForm with Calendar Icon
    By excellenthelp in forum Excel Programming / VBA / Macros
    Replies: 45
    Last Post: 07-29-2013, 01:43 PM
  3. Userform Icon
    By mqdias in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2007, 01:57 PM
  4. Userform Icon
    By gti_jobert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2006, 03:25 PM
  5. show icon caption bar in userform
    By tom taol in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2006, 07:45 AM

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