Results 1 to 3 of 3

Thread: Excel or Google Sheets help

  1. #1
    Senior Member Mobile PC's Avatar
    Join Date
    Jan 2014
    Location
    Cleveland, Ohio
    Posts
    491
    vCash
    501
    Points
    105,867
    Bank
    0
    Total Points
    105,867
    Donate

    Excel or Google Sheets help

    Have a client, who uses Excel as a route list for his work. Is there a way to have him click on the empty square and have the current date automatically inputted? Or when touched on a touch screen tablet? In the winter, on a separate workbook, he would need not only the date, but the time. Willing to pay, if someone could help.2018-02-08.jpg

  2. #2
    Senior Member CeeBee's Avatar
    Join Date
    Jan 2014
    Posts
    1,637
    vCash
    1792
    Points
    80,512
    Bank
    0
    Total Points
    80,512
    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 06:19 PM.

  3. #3
    Senior Member Mobile PC's Avatar
    Join Date
    Jan 2014
    Location
    Cleveland, Ohio
    Posts
    491
    vCash
    501
    Points
    105,867
    Bank
    0
    Total Points
    105,867
    Donate
    Thanks Cee Bee. Showed him this, didn't know about the shortcuts for date or time. He's using the shortcuts, no need for macro. Thanks!!

Posting Permissions

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