+ Reply to Thread
Results 1 to 5 of 5

Run Macro If Cell Value = 1

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Run Macro If Cell Value = 1

    Hi

    I have a spreadsheet with several worksheets and I need to run a macro to copy a webpage and paste it into one of the worksheets. This I am doing fine already. What I would like to do is have the macro run automatically if a cell equals a certain value.

    The first Worksheet is named "Data" and if the value of cell AE1 = 1 I want the macro to activate. The second worksheet is named "Arg" and it is here that i want the webpage pasted.
    Here is the code I have:

    Please Login or Register  to view this content.
    what have I done wrong? Any help would be appreciated.

    Doug
    Last edited by boohah; 05-25-2010 at 09:50 AM. Reason: Code Tags

  2. #2
    Registered User
    Join Date
    01-23-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Run Macro If Cell Value = 1

    I have tried it a different way with the following code and still no luck:

    Please Login or Register  to view this content.
    Any help would be appreciated

  3. #3
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184

    Re: Run Macro If Cell Value = 1

    in "ThisWorkbook" add the following code:

    Please Login or Register  to view this content.
    then in a module, insert your macro. for example
    Please Login or Register  to view this content.
    Last edited by wamp; 05-25-2010 at 03:10 AM.
    _______________________________________________
    Remember:

    Read the rules!

    Use code tags! Place [CODE] before the first line of code and [/CODE] after the last line of code.

    Mark your post [SOLVED] if it has been answered satisfactorily.
    To do this, click EDIT in your original post, click GO ADVANCED and set the PREFIX. It helps everybody!

    If you are approve (or disapprove) of any members response to your problem, please click the star icon underneath their post and comment. It matters.

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

    Re: Run Macro If Cell Value = 1

    I think you'd be better off using a webquery (menubar/data/external data, webquery). one of its properties is the refreshtime.
    Last edited by snb; 05-25-2010 at 11:35 AM.

  5. #5
    Registered User
    Join Date
    01-23-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Run Macro If Cell Value = 1

    Thanks snb, i think i am good with what you have said already. Thank you for your help

    Doug

+ 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