Results 1 to 3 of 3

Thread: Excel or Google Sheets help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Senior Member CeeBee's Avatar
    Join Date
    Jan 2014
    Posts
    1,677
    vCash
    1792
    Points
    219,250
    Bank
    0
    Total Points
    219,250
    Donate
    It's doable, but requires macros. I don't know how well GS can handle it. Many mobile editors seem to get stuck on macros.
    Alternatively [ Ctrl ; ] is a nifty shortcut
    Or https://yourbusiness.azcentral.com/i...cel-10658.html

    But if you want the macro route...
    Code:
    Option Explicit
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Cells.Count > 1 Then Exit Sub
        Dim lookupRange As String: lookupRange = "A1:A10000"
        Dim timeNow As Date
        If Not Intersect(Target, Range(lookupRange)) Is Nothing Then
            If Target(1, 1) = "" Then
                timeNow = DateTime.Now
                Target(1, 1).Value = Format(timeNow, "yyyy-MM-dd hh:mm:ss")
            End If
        End If
    End Sub
    Add the macro into the sheet...
    It will only insert the date if the cell is empty.
    I'd just leave the date/time as is and format the cells rather than modify the code to spit date OR time.
    Change the cells range watching for click as needed...
    Last edited by CeeBee; 02-09-2018 at 07:19 PM.

Posting Permissions

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