+ Reply to Thread
Results 1 to 5 of 5

How to Automatically refresh sheet containing VBA Function

  1. #1
    Registered User
    Join Date
    08-06-2020
    Location
    Montana, USA
    MS-Off Ver
    2007
    Posts
    2

    How to Automatically refresh sheet containing VBA Function

    I have sheet that queries warehouse stock on internet using a VBA function to display current stock levels of a few key items.
    I can use Ctrl+Alt+F9 to refresh and that does the job successfully.
    Question is... how can I refresh sheet automatically every 60 seconds? (Range B1:B3)


    Col A Col B
    AB-121 =Wstock(A1)
    AB-230 =Wstock(A2)
    CA-460 =Wstock(A3)


    I'm using Excel2007.

    Any help is appreciated.

    Lee
    Last edited by LeeB9622; 08-06-2020 at 02:14 PM. Reason: update

  2. #2
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    101

    Re: How to Automatically refresh sheet containing VBA Function

    Hello LeeB9622,

    This is something that I have came up with. You can tweak it to work for your needs.

    The macro below goes through a loop and refreshes a sheet on the workbook at set intervals. Currently, it is set to refresh 6 times every 3 seconds on the active sheet. All of this can be changed to your liking.

    Please Login or Register  to view this content.
    There might be a more elegant way of doing this, but this is the method I have used before.

    Best regards,
    ~Frab

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: How to Automatically refresh sheet containing VBA Function

    Maybe you can try like this:

    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Registered User
    Join Date
    08-06-2020
    Location
    Montana, USA
    MS-Off Ver
    2007
    Posts
    2

    Re: How to Automatically refresh sheet containing VBA Function

    Tried the following :
    Please Login or Register  to view this content.
    Works when cells contain =RAND() but not with =WSTOCK(A1)
    Does work however with Ctrl+Alt+F9

    Why does it not recalc with my Calculate_Range Sub?

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: How to Automatically refresh sheet containing VBA Function

    Add into your WSTOCK function as 1st line:

    Please Login or Register  to view this content.
    then should works with your Calculate_Range sub.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Automatically refresh sheet
    By parbynat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-06-2019, 03:40 AM
  2. [SOLVED] automatically refresh page
    By chriswrcg in forum Excel General
    Replies: 2
    Last Post: 06-07-2018, 10:46 AM
  3. [SOLVED] automatically refresh all pivots
    By esbencito in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2018, 07:26 AM
  4. Web page refresh automatically
    By Venkatesh.S in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2016, 10:44 PM
  5. How to refresh multiple sheet automatically and save it as values
    By cool_anu4u in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2014, 05:12 PM
  6. Refresh workbook automatically
    By Richard in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-07-2006, 01:44 AM
  7. [SOLVED] Formula do not refresh automatically
    By PS in forum Excel General
    Replies: 4
    Last Post: 05-09-2005, 04:06 AM

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