+ Reply to Thread
Results 1 to 7 of 7

Capture value from a dynamic cell at a specific Hour and populate a column

Hybrid View

  1. #1
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,021

    Re: Capture value from a dynamic cell at a specific Hour and populate a column

    You put the event code into a standard codemodule rather than the Thisworkbook object's codemodule: I have attached a working version with one change that I made to make testing easier: instead of 1200/2400 I use TimeSerial(12,0,0) (if you wanted to run at 11:47 AM, you would not use 1147/2400: TimeSerial(11,47,0) will allow you to choose that as the exact time.
    Attached Files Attached Files
    Bernie Deitrick
    Excel MVP 2000-2010

  2. #2
    Registered User
    Join Date
    01-02-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    54

    Re: Capture value from a dynamic cell at a specific Hour and populate a column

    hi,

    It is working. Thanks for the effort and time.

    Issues I noticed:
    Right now it saves the required data when we close and reopen the file. It does not do it at the designated time when the workbook is open.
    Also reopening the workbook multiple times on same date it shows multiple entries of the same date.

    Though my basic requirement has been met it would be nice if above issues are addressed.

    Thanks again,

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,021

    Re: Capture value from a dynamic cell at a specific Hour and populate a column

    Change RunMe to this to address the multiple saves:
    Sub RunMe()
        Dim shW As Worksheet
        Set shW = ThisWorkbook.Worksheets("SheetName")
        If shW.Cells(shW.Rows.Count, "A").End(xlUp).Value = Date Then Exit Sub
        shW.Cells(shW.Rows.Count, "A").End(xlUp)(2).Value = Date
        shW.Cells(shW.Rows.Count, "A").End(xlUp)(1, 2).Value = shW.Range("A1").Value
    End Sub

    The timing / schedule works for me: are you opening the workbook once in the morning and closing it after the time that you want to store the data?

  4. #4
    Registered User
    Join Date
    01-02-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    54

    Re: Capture value from a dynamic cell at a specific Hour and populate a column

    This solves multiple saves.

    w.r.t. timing I will use it for a while and revert with observation.

    Thanks,

+ 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] How to capture a max value in a dynamic cell
    By toughy1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-08-2019, 04:38 PM
  2. [SOLVED] Populate a specific cell with column heading name.
    By redoscar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-10-2017, 04:11 PM
  3. Replies: 1
    Last Post: 02-12-2015, 01:48 PM
  4. Replies: 5
    Last Post: 09-26-2014, 10:51 AM
  5. Replies: 4
    Last Post: 04-29-2014, 10:04 AM
  6. Replies: 3
    Last Post: 01-06-2011, 01:16 AM
  7. capture unique values from 1 column and populate the result into another column
    By teachMeExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2009, 05:21 PM

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