+ Reply to Thread
Results 1 to 4 of 4

Refering to a userform in a procedure

  1. #1
    Forum Contributor
    Join Date
    02-01-2021
    Location
    Manchester
    MS-Off Ver
    365
    Posts
    222

    Refering to a userform in a procedure

    I have a subroutine that will be used several times which needs to refer to a different UserForm each time.
    I have not been able to find the code which will allow me to do this.

    I was hopeful of :-
    Please Login or Register  to view this content.
    But this gives an error message "Object required" at the Set line. I am a bit out of my depth and would like some help please
    John

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Refering to a userform in a procedure

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.

    Hope this helps.

    Regards,

    Greg M

  3. #3
    Forum Contributor
    Join Date
    02-01-2021
    Location
    Manchester
    MS-Off Ver
    365
    Posts
    222

    Re: Refering to a userform in a procedure

    Greg,
    I have just finished checking out your idea in my context and I am delighted. It all worked perfectly.
    Thank you very much for giving me your time and effort.
    I am a bit puzzled as to hoiw it works though. Is vbMethod a constant of CallByName?
    John

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Refering to a userform in a procedure

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    The following link might give you some more information about the various CallType arguments used by the CallByName method:



    Best regards,

    Greg M

+ 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. Need userform to stop procedure
    By hkbhansali in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2018, 09:45 AM
  2. Why is my UserForm Pausing Procedure?
    By jasoncw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2007, 05:20 PM
  3. Cancel a Procedure through a Userform
    By jumpjump in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2005, 05:05 AM
  4. [SOLVED] Running Userform Procedure
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2005, 03:05 AM
  5. Aborting a Sub procedure from a UserForm
    By shellshock in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2005, 09:05 AM
  6. userform output to procedure
    By shellshock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2005, 06:31 PM
  7. Looping procedure calls userform; how to exit loop (via userform button)?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2005, 08:05 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