Create static timestamp when radio button/ macro is actioned

  • Hi all


    I have assigned a macro to a radio (print) button that will print a specific range (report) and insert a timestamp in a dedicated cell to indicate the date/ time when that report was printed (using the =NOW() function)

    There are multiple buttons with the assigned macros and cell ranges updated respectively but, regardless of which button I press, all other timestamps update to reflect the time the most recent button was actioned.

    If someone could review the code below and make a suggestion it would be appreciated


    Sub Button2_Click()


    Sheets("Oil Record Book Sheets").Select

    Range("A93:I184").Select

    Selection.PrintOut Copies:=1, Collate:=True

    Sheets("Worksheet").Select

    Range("R36").Select

    ActiveCell.FormulaR1C1 = "=NOW()"

    Range("R37").Select

    End Sub

  • Hi,


    You could test the following


    Code
    Sub Button2_Click()
    Sheets("Oil Record Book Sheets").Range("A93:I184").PrintOut Copies:=1, Collate:=True
    With Sheets("Worksheet").Range("R36")
        .FormulaR1C1 = "=NOW()"
        .NumberFormat = "d/mm/yyyy hh:mm:ss"
        .Value = .Value
    End With
    Range("R37").Select
    End Sub

    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Glad you could fix your problem ;)


    Thanks a lot ... for both your Thanks ...AND for the Like :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!