Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA form as macro (2000)-MULTI-VBA form as macro (2000)

    I'm rather new to VBA, but have familiarity with Basic. I managed to generate a form in the vba editor, which runs as required on the associated (active?) worksheet. But I can only run it from within the vba editor.

    I'm hoping there is a simple way to assign it to run as a worksheet macro with a hotkey or toolbar icon. It has eluded me how to "connect" running the form with a worksheet macro. Maybe there's a better way, but as said, I'm very green with this, my experience ending at Wordbasic (2.0)!

    Any help much appreciated.

    Alan Miller

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA form as macro (2000)-MULTI-VBA form as macro (2000)

    One uses another sub to show any form. This can be an event procedure behind a controlbutton on a sheet, but also a subroutine in a normal module to which one can assign a hot key. the last:

    Insert a module,

    Type this into it:

    Option Explicit

    Sub ShowMyForm()
    TheNameOfYourUserform.Show
    Unload TheNameOfYourUserform
    End Sub

    Now in XL, Tools, Macro, Macros, select "ShowMyForm", press Options, enter shortcut key.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA form as macro (2000)-MULTI-VBA form as macro (2000)

    Many thanks Jan.
    I think it's the "missing link" I was after.

    Alan

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA form as macro (2000)-MULTI-VBA form as macro (2000)

    And it works! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Thanks Jan.

    Alan

Posting Permissions

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