2007 EXCEL IF and NOW function

kccheun2

New Member
Joined
Apr 4, 2013
Messages
2
I am trying to create a time sensitive file. I want to use the IF function to record the time when I input a record.

Under A1 I use: =if(B2, Now(), 0)

Since I need to input records every five minutes or more, I need the A1 to display the time EXACTLY when I put a 1 on B2.

I tried my function and it only gives me the first part of what I need. I need A1 to not correct and refresh itself after the initial input of B1.

Please help .

Thank you
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You could do it with an event macro that triggers when you put a value in column B.

  • Right-click on the worksheet tab
  • Select View Code from the pop-up context menu
  • Paste the code below in the VBA edit window

Code:
[color=darkblue]Private[/color] [color=darkblue]Sub[/color] Worksheet_Change([color=darkblue]ByVal[/color] Target [color=darkblue]As[/color] Range)
    [color=darkblue]If[/color] Target.Count = 1 [color=darkblue]Then[/color]
        [color=darkblue]If[/color] Target.Column = 2 And [color=darkblue]Not[/color] IsEmpty(Target) [color=darkblue]Then[/color]   [color=green]'Column B changed[/color]
            Target.Offset(, -1).Value = Now  [color=green]'Timestamp column A[/color]
        [color=darkblue]End[/color] [color=darkblue]If[/color]
    [color=darkblue]End[/color] [color=darkblue]If[/color]
End [color=darkblue]Sub[/color]
 
Upvote 0

Forum statistics

Threads
1,203,352
Messages
6,054,910
Members
444,759
Latest member
TeckTeck

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top