• Last date edited - in a single cell to be updated every time a shee

    From meleady420@21:1/5 to All on Thu Nov 5 08:11:30 2020
    On Thursday, 5 November 2020 at 15:31:17 UTC, meleady420 wrote:
    Hi,

    I have a workbook with multiple sheets.

    I need an automatically updated cell that updates every time the sheet is edited and I will need this on multiple tabs that update individually only when that specific tab is updated.

    "Last updated: DD MM YY"

    Thankyou in advance for any help.


    Automatically updates with the date!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Auric__@21:1/5 to All on Thu Nov 5 17:41:36 2020
    meleady420 wrote:

    On Thursday, 5 November 2020 at 15:31:17 UTC, meleady420 wrote:
    Hi,

    I have a workbook with multiple sheets.

    I need an automatically updated cell that updates every time the sheet
    is edited and I will need this on multiple tabs that update
    individually only when that specific tab is updated.

    "Last updated: DD MM YY"

    Thankyou in advance for any help.

    Automatically updates with the date!

    You'll likely need to script it with VBA. Put this in the workbook's ThisWorkbook object:

    Private changed As Boolean

    Private Sub Workbook_SheetChange(ByVal Sh As Object, _
    ByVal Target As Range)
    If changed Then Exit Sub
    changed = True
    Sh.Range("A1").Value = "Last updated: " & IIf(Day(Now) < 10, "0", "") _
    & Day(Now) & IIf(Month(Now) < 10, " 0", " ") & _
    Month(Now) & " " & Right(Year(Now), 2)
    changed = False
    End Sub

    Replace "A1" with the address you want the date at, and bear in mind that it will be the same location on each sheet.

    This will only mark a sheet as updated if it is the updated page, resulting
    in different dates on each sheet. If you need the date to be the same on
    each sheet, use this instead, still in ThisWorkbook:

    Private changed As Boolean

    Private Sub Workbook_SheetChange(ByVal Sh As Object, _
    ByVal Target As Range)
    If changed Then Exit Sub
    Dim x As Worksheet
    changed = True
    For Each x In Sheets
    x.Range("A1").Value = "Last updated: " & IIf(Day(Now) < 10, "0", "") _
    & Day(Now) & IIf(Month(Now) < 10, " 0", " ") & _
    Month(Now) & " " & Right(Year(Now), 2)
    Next x
    changed = False
    End Sub

    --
    Between two evils, I choose the competent one.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From meleady420@21:1/5 to All on Mon Nov 9 00:44:20 2020
    On Thursday, 5 November 2020 at 17:41:40 UTC, Auric__ wrote:
    meleady420 wrote:

    On Thursday, 5 November 2020 at 15:31:17 UTC, meleady420 wrote:
    Hi,

    I have a workbook with multiple sheets.

    I need an automatically updated cell that updates every time the sheet
    is edited and I will need this on multiple tabs that update
    individually only when that specific tab is updated.

    "Last updated: DD MM YY"

    Thankyou in advance for any help.

    Automatically updates with the date!
    You'll likely need to script it with VBA. Put this in the workbook's ThisWorkbook object:

    Private changed As Boolean

    Private Sub Workbook_SheetChange(ByVal Sh As Object, _
    ByVal Target As Range)
    If changed Then Exit Sub
    changed = True
    Sh.Range("A1").Value = "Last updated: " & IIf(Day(Now) < 10, "0", "") _
    & Day(Now) & IIf(Month(Now) < 10, " 0", " ") & _
    Month(Now) & " " & Right(Year(Now), 2)
    changed = False
    End Sub

    Replace "A1" with the address you want the date at, and bear in mind that it will be the same location on each sheet.

    This will only mark a sheet as updated if it is the updated page, resulting in different dates on each sheet. If you need the date to be the same on
    each sheet, use this instead, still in ThisWorkbook:

    Private changed As Boolean

    Private Sub Workbook_SheetChange(ByVal Sh As Object, _
    ByVal Target As Range)
    If changed Then Exit Sub
    Dim x As Worksheet
    changed = True
    For Each x In Sheets
    x.Range("A1").Value = "Last updated: " & IIf(Day(Now) < 10, "0", "") _
    & Day(Now) & IIf(Month(Now) < 10, " 0", " ") & _
    Month(Now) & " " & Right(Year(Now), 2)
    Next x
    changed = False
    End Sub

    --
    Between two evils, I choose the competent one.
    Thanks alot for your help but i cant get this working.
    Any advice much appreciated.
    - I am in a macro enabled workbook
    - Alt F11
    - Copy and past the test above
    - Alt Q

    Am i missing any steps?

    I have tried then using Alt F8 and changed A1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thibaud Taudin Chabot@21:1/5 to All on Mon Nov 9 15:13:56 2020
    Op 5-11-2020 om 17:11 schreef meleady420:
    On Thursday, 5 November 2020 at 15:31:17 UTC, meleady420 wrote:
    Hi,

    I have a workbook with multiple sheets.

    I need an automatically updated cell that updates every time the sheet is edited and I will need this on multiple tabs that update individually only when that specific tab is updated.

    "Last updated: DD MM YY"

    Thankyou in advance for any help.


    Automatically updates with the date!


    https://www.extendoffice.com/documents/excel/3507-excel-last-saved-timestamp.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Auric__@21:1/5 to All on Mon Nov 9 19:31:01 2020
    meleady420 wrote:

    [snip]
    Thanks alot for your help but i cant get this working.
    Any advice much appreciated.
    - I am in a macro enabled workbook
    - Alt F11
    - Copy and past the test above
    - Alt Q

    Am i missing any steps?

    I have tried then using Alt F8 and changed A1

    * Did you allow macros to run? (Security settings might prevent them from running.)

    * Did you put it in the workbook's ThisWorkbook object? (It *must* go there.)

    * Is there already a Sub Workbook_SheetChange? (You'll have to merge them together.)

    * Did you ensure you were using only one of my subs at a time? (It's one or
    the other, not both.)

    * Did you actually make a change in a worksheet? (It's not magic; the code won't fire unless you change some data, not just formatting. Select a blank cell and hit the Del key.)


    If you answered "yes" to all of the above, then try the page that Thibaud Taudin Chabot linked to. It's a method I'd never heard of before,
    specifically ActiveWorkbook.BuiltinDocumentProperties("Last Save Time").

    --
    She had not thought these words as she saw the humans coming to kill,
    but it was in words that Ender understood her.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)