+ Reply to Thread
Results 1 to 8 of 8

How to run a Macro from a vba script

  1. #1
    Registered User
    Join Date
    07-13-2011
    Location
    hull.england
    MS-Off Ver
    Excel 2003
    Posts
    12

    How to run a Macro from a vba script

    Hi all,

    I have a macro which works great but i need away to make it run when cell a1 value changes to 2. But i only want it to run once untill the next time a1 changes to 2 again, my biggest issue is that a1 could have a value of 2 for some seconds and I don't want the macro to keep running untill the value changes. Cell a1 also has a formula in it.

    Thanks in advance
    Last edited by datahouse; 11-02-2011 at 01:12 PM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to run a Macro from a vba script

    It looks like an interesting, but unfortunately hardly comprehensible problem, because you omitted to post a sample workbook, containing that well functioning macro.



  3. #3
    Registered User
    Join Date
    07-13-2011
    Location
    hull.england
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: How to run a Macro from a vba script

    Sorry please find attached the file i am working on. Regards
    Gav
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to run a Macro from a vba script

    Maybe
    Please Login or Register  to view this content.
    Worksheet event code is stored on a worksheet module. To add it to your worksheet, do the following:

    Copy the code
    Select the worksheet in which you the code to run
    Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
    Where the cursor is flashing, choose Edit | Paste
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    07-13-2011
    Location
    hull.england
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: How to run a Macro from a vba script

    Resolved thanks for your help

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to run a Macro from a vba script

    How was it resolved & please mark solved

  7. #7
    Registered User
    Join Date
    07-13-2011
    Location
    hull.england
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: How to run a Macro from a vba script

    Hi Roy,

    We found a code from a search on here that we edited to work for us. This a a great site and everyone is really helpful.

    Sorry but how do i mark as resolved?

    Thanks

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: How to run a Macro from a vba script

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Everyone who confuses correlation and causation ends up dead.

+ 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