Then function ??

  • Thread starter Thread starter Jack Black
  • Start date Start date
J

Jack Black

#1 I want to enter the (NOW) function in A1 and next to it enter a
number. (a diabetes blood sugar measurement)

I want to do this every day with tomorrws date being in A2 and the
number in B2. My problem is that each day A1 changes to the current
NOW........how do I get it to show yesterdays date?

#2. I have been (mis) using the NOW function for a few days, now
everytime I hit the functions button that's the only function I can
get. How can I tell it that I also want to use other functions as
well?

Thanks
 
#1 you need to either enter the time using Ctrl-;, and Ctrl-Shift-:, or use
VBA.

#2 - select a cell without the NOW function already populated.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Bob suggested VBA.

Here is some sheet event code from a sheet I use for charting my readings that
pops the date and time into Column A when you enter a glucose reading in Column
B.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
''Col B time will not change if data in Col A is edited
On Error GoTo enditall
If Target.Cells.Column = 2 Then
n = Target.Row
If Excel.Range("B" & n).Value <> "" _
And Excel.Range("A" & n).Value = "" Then
Excel.Range("A" & n).Value = Format(Now, "dd mmm yyyy hh:mm")
End If
End If
enditall:
End Sub

Right-click on your sheet tab and "View Code". Copy/paste the code into that
module.


Gord Dibben MS Excel MVP
 
Back
Top