ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Then function ?? (https://www.excelbanter.com/excel-discussion-misc-queries/148784-then-function.html)

Jack Black

Then function ??
 
#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

Bob Phillips

Then function ??
 
#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)

"Jack Black" wrote in message
...
#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




Gord Dibben

Then function ??
 
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.

Jack Black

Then function ??
 
Thanks. The VBA works great,





On Tue, 03 Jul 2007 07:17:58 -0700, Gord Dibben <gorddibbATshawDOTca
wrote:

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




All times are GMT +1. The time now is 04:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com