Results 1 to 3 of 3

Executing a Macro with Variable Name from String

Threaded View

zeuscartwright Executing a Macro with... 08-22-2013, 01:25 AM
romperstomper Re: Executing a Macro with... 08-22-2013, 01:37 AM
zeuscartwright Re: Executing a Macro with... 08-22-2013, 01:43 AM
  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Exclamation Executing a Macro with Variable Name from String

    Hi Again Team,

    I'm trying to execute a macro based on the value of a string.

    Does anyone know how this could be done?

    I have this so far:

    ' Function to open the correct UserForm.
    Sub OpenUserForm(UserFormName As Variant, UserFormAction As Variant)
    '   Prepare the UserForm
        MacroName = "PrepareForm" & UserFormAction
        MacroName (UserFormName)
    '   Show the UserForm
        VBA.UserForms.Add(UserFormName).Show
    End Sub
    Last edited by zeuscartwright; 08-22-2013 at 01:45 AM. Reason: Sovled

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] insert variable string in email macro
    By ag273n in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2013, 06:47 PM
  2. Replies: 4
    Last Post: 07-12-2013, 12:14 PM
  3. Macro to open files based on string variable
    By Coeus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2013, 06:47 PM
  4. Transferring a dynamically named string variable to another string variable.
    By Concorde Rules in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2012, 04:08 AM
  5. Passing String Variable from Command Button Macro to a List Box in same User Form
    By wz4np1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2012, 11:31 AM

Tags for this Thread

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