+ Reply to Thread
Results 1 to 6 of 6

Update excel sheet automatically every day

  1. #1
    Registered User
    Join Date
    02-24-2016
    Location
    Oslo
    MS-Off Ver
    Office 365
    Posts
    59

    Update excel sheet automatically every day

    By now, I've created a macro that fetches a table from IE containing the NOK swap rates. After the table is stored in one sheet, the macro stores the values I need (3yr swap, 5yr swap and 10yr swap) in another sheet. This macro works (pretty) very vell, but now I need to make it a little more advanced and I can't figure out how to solve my problem.

    2 problems:
    • I would like the macro to only save one value each day, and I want that value to be the "close" value. By now, the macro create a new row and saves the values each time I run the macro.
    • I would really like the macro to run by it self at a spesific time of the day. It really doesn't matter when, but maybe after 17.00 and before 24.00.

    To summerize I would like to tweek my original macro to only create one row a day (3yr, 5yr, 10yr swap) and I would really like it to update automatically.

    See attached workbook.

    Best regards
    Thomas
    Attached Files Attached Files

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update excel sheet automatically every day

    Hi there,

    Take a look at the attached version of your workbook and see if it does what you need. It uses the following code in the VBA CodeModule of the "Swap" worksheet:

    Please Login or Register  to view this content.

    and the following code in the VBA CodeModule for "ThisWorkbook":

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your requirements.

    These statements should be included for "normal" operation, and commented out for demonstration puropses.

    These statements should be included for demonstration purposes, and commented out or deleted for "normal" operation.


    I don't have access to your "Swap.xlsm" workbook, so I can't test the operation of your "Worksheet_Change" routine.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update excel sheet automatically every day

    Hi again,

    Sorry, the "CancelProcedure" routine should have included the following highlighted lines:

    Please Login or Register  to view this content.

    Regards and apologies,

    Greg M

  4. #4
    Registered User
    Join Date
    02-24-2016
    Location
    Oslo
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Update excel sheet automatically every day

    Thank you very much, Greg. I seems to work pretty fine, but I'm struggling to implement my original code to store the values I need (3yr swap, 5yr swap and 10yr swap) in another sheet.

    Do you see what I'm doing wrong.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update excel sheet automatically every day

    Hi again,

    Many thanks for your feedback.

    See if the attached workbook does what you need. It uses the following code in a standard VBA CodeModule:

    Please Login or Register  to view this content.

    and the following code in the VBA CodeModule for "ThisWorkbook":

    Please Login or Register  to view this content.

    The highlighted values may be altered to suit your requirements.

    Include these lines for demonstration purposes and delete them for "normal" execution.

    Comment-out this line for demonstration purposes and include it for "normal" execution.


    Hope this helps - as before, please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-24-2016
    Location
    Oslo
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Update excel sheet automatically every day

    Hi again Greg,

    Thank you very much for your excellent reply. I don’t know why I haven’t responded to your answer before. Sorry for that.

    It used to work like charm, but suddenly now I get “Object required" and I can't figure out how to solve the it.

    I've looked over and can't find any typos or anything. What am I missing?


    Regards
    Thomas
    Last edited by Mangorni; 03-07-2023 at 08:23 AM.

+ 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. Update File Name in folder automatically in Excel sheet
    By poonam.ss in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2017, 08:15 AM
  2. Update automatically link path excel sheet
    By kpsmith12 in forum Excel General
    Replies: 7
    Last Post: 01-18-2016, 01:23 PM
  3. Replies: 1
    Last Post: 10-19-2015, 11:33 AM
  4. Adding or deleting rows in master sheet and automatically update target sheet
    By RLR31064 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2014, 01:39 PM
  5. Replies: 1
    Last Post: 05-16-2014, 02:09 PM
  6. Replies: 0
    Last Post: 08-03-2006, 02:10 AM
  7. How do i update hyperlink in excel spread sheet automatically.
    By Phanichand Mudumba in forum Excel General
    Replies: 1
    Last Post: 09-13-2005, 01:05 PM

Tags for this Thread

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