Consulting

Results 1 to 2 of 2

Thread: VBA Time Stamp for single cell entry

  1. #1
    VBAX Regular
    Joined
    Oct 2015
    Location
    Vista CA
    Posts
    36
    Location

    VBA Time Stamp for single cell entry

    what would the VBA be to enter a date in a single cell when a template file is opened and keep that date frozen after it is saved?
    If I need to set a condition, maybe something like if A1>0,Now() formatted for just the date.

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    606
    Location
    .
    In the module ThisWorkbook :

    Option Explicit
    
    Private Sub Workbook_Open()
        If Sheet1.Range("A1").Value > 0 Then
            Sheet1.Range("B1").Value = Now()
        End If
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •