+ Reply to Thread
Results 1 to 5 of 5

Data Logging?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-30-2009
    Location
    US
    MS-Off Ver
    Excel 2003, 2010, 2016, 2019, & Office 365
    Posts
    194

    Data Logging?

    Hello,

    I have a worksheet with a script that will go out and fetch interest rates from a website. Someone pulls this data once every day and it works great. Is there a way to create a new worksheet where I can have data from a cell logged? For example if cell C4 has an interest rate it would get logged in a separate worksheet in A1. The next day when the rates are imported, the new value would automatically get saved to A2, so on and so forth to keep a log and we can historically look at all the rates?

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Data Logging?

    Is there a way to create a new worksheet where I can have data from a cell logged?
    Yes there is. Post a small example file to show your layout and a result sheet showing the desired outcome.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Contributor
    Join Date
    12-30-2009
    Location
    US
    MS-Off Ver
    Excel 2003, 2010, 2016, 2019, & Office 365
    Posts
    194

    Re: Data Logging?

    Hi,

    Thanks for helping me. Attached is a file that will get rates, and I make a results worksheet with the desired outcome.

    Thank you!
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Data Logging?

    Let's start with this one.

    Sub tst()
        Dim mydate As Date, sh As Worksheet
        Set sh = Sheets("Libor Interest Rates")
        
        With CreateObject("VBScript.RegExp")
            .Pattern = "\d{1,2}\/\d{1,2}\/\d{2,4}"
            mydate = .Execute(sh.Range("A12").Value).Item(0).Value
        End With
        
        With Sheets("Results Tab")
            If Not IsError(Application.Match(CDbl(mydate), .Columns(1), 0)) Then Exit Sub
            .Range("A" & .Rows.Count).End(xlUp).Offset(1) = mydate
            .Range("B" & .Rows.Count).End(xlUp).Offset(1) = sh.Range("C6").Value
            .Range("C" & .Rows.Count).End(xlUp).Offset(1) = mydate
            .Range("D" & .Rows.Count).End(xlUp).Offset(1) = sh.Range("C10").Value
        End With
    End Sub

  5. #5
    Forum Contributor
    Join Date
    12-30-2009
    Location
    US
    MS-Off Ver
    Excel 2003, 2010, 2016, 2019, & Office 365
    Posts
    194

    Re: Data Logging?

    Exactly what I was looking for. Thanks so much man!

+ 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. [SOLVED] Data Logging Assistance
    By JordanMO in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2016, 07:51 PM
  2. Replies: 1
    Last Post: 08-11-2015, 04:07 PM
  3. Logging Data Using a Timer?
    By gravitycat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2015, 08:36 PM
  4. Excel 2007 : Logging XML/RSS data
    By pgh1212 in forum Excel General
    Replies: 0
    Last Post: 07-22-2010, 09:52 PM
  5. Logging data with DDE link
    By whtrader in forum Excel General
    Replies: 1
    Last Post: 12-05-2006, 10:13 AM
  6. [SOLVED] Logging data using the same textfile over and over again
    By Silencer116 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2006, 07:15 AM
  7. [SOLVED] Live DDE Data Logging
    By MadManInABox in forum Excel General
    Replies: 1
    Last Post: 09-19-2005, 05:05 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