+ Reply to Thread
Results 1 to 3 of 3

Calling a Macro from module

  1. #1
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161

    Calling a Macro from module

    I have Public Sub Unlockbuttons() Macro recorded in a module.

    How do I execute this macro from within code in a userform. I'm using this code:

    If Sheet6.Range("f49") = 0 And Sheet6.Range("f59").Text = Sheet6.Range("f50").Text Then

    'Here is where I need the code to execute the Unlockbuttons macro

    Would appreciate any guideance
    Cheers

    Peter (Working my way through first VBA project)

  2. #2
    Norman Jones
    Guest

    Re: Calling a Macro from module

    Hi Peter,

    Try:

    With Sheets("Sheet6")
    If .Range("F49").Value = 0 _
    And .Range("F59").Value = .Range("F50").Value Then
    Call UnlockButtons
    End If
    End With

    ---
    Regards,
    Norman



    "peter.thompson"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have Public Sub Unlockbuttons() Macro recorded in a module.
    >
    > How do I execute this macro from within code in a userform. I'm using
    > this code:
    >
    > If Sheet6.Range("f49") = 0 And Sheet6.Range("f59").Text =
    > Sheet6.Range("f50").Text Then
    >
    > 'Here is where I need the code to execute the Unlockbuttons macro
    >
    > Would appreciate any guideance
    > Cheers
    >
    > Peter (Working my way through first VBA project)
    >
    >
    > --
    > peter.thompson
    > ------------------------------------------------------------------------
    > peter.thompson's Profile:
    > http://www.excelforum.com/member.php...o&userid=29686
    > View this thread: http://www.excelforum.com/showthread...hreadid=503579
    >




  3. #3
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161
    Thanks Norman, much appreciated

    Cheers

    Peter

+ 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