+ Reply to Thread
Results 1 to 7 of 7

Automatcially execute VBA Macro

  1. #1
    Registered User
    Join Date
    01-01-2010
    Location
    london, england
    MS-Off Ver
    Excel 2007
    Posts
    26

    Automatcially execute VBA Macro

    Hi,

    Hoping someone can help.

    I don't know much about VBA - in particular within Excel. However, I have created the following "sub"...

    Please Login or Register  to view this content.
    The macro works but only when I manually run this within the workbook. Can anyone help me to make sure this runs continiously? For example, when cell C1 in sheet 21 changes, for the VBA script to run - I don't want to have to do this automatically.


    Sorry if this question has already been asked. A step by step guide will be useful.

    Many thanks,

    Nick
    Last edited by arlu1201; 05-29-2013 at 07:32 AM.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Automatcially execute VBA Macro

    Put it in a worksheet change event.

    Please Login or Register  to view this content.
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    01-01-2010
    Location
    london, england
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Automatcially execute VBA Macro

    Many thanks for this.

    How do I create a worksheet change event in Excel 2000? I am very new.

    Thanks again,

    Nick

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Automatcially execute VBA Macro

    Open the VB Editor. Click on Sheet1 in the left window. In the right window after clicking, paste in JasperD's code.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Automatcially execute VBA Macro

    nickm84,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Registered User
    Join Date
    01-01-2010
    Location
    london, england
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Automatcially execute VBA Macro

    Please can you kindly help once again. I have modified the above and come up with the following (which works) for a slightly different sheet. Can anyone advise if this coding can be reduced as there is a lot of repetition:

    Please Login or Register  to view this content.
    Many thanks,

    Nick

  7. #7
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Automatcially execute VBA Macro

    Your adjustments doesn't make sense...

    Why didn't you adjust it to this :
    Please Login or Register  to view this content.
    Please click the * below if this helps

+ 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