Inserting Date

virtual-bird

New Member
Joined
Mar 4, 2002
Messages
7
This has to be so simple, my brain has farted, and I cant think...

I am setting up a spreadsheet, so that when I insert data in cell A* that the date is automatically inserted in cell B*

Ive used the =NOW() it works sort of.

BUT!

EG. if I enter data in cell A33 the date and time set in ALL earlier cells is changed to current time and date..

Thanks for ya time too.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
This will put the date and time in column B when you enter something in column A, take out time & " " & if you don't want the time. Hope this helps
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count > 1 Then Exit Sub
Select Case Target.Column
Case 1
Cells(Target.Row, 2) = Time & " " & Date
End Select
End Sub
 
Upvote 0
Sorry to sound stoopid, but this formula, where do I enter that?

If I type it into a cell, it comes up as text.

Is it something special?

Im using Office 97.

Thanks as well for ya help.
This message was edited by virtual-bird on 2002-03-05 17:00
 
Upvote 0
OK.
I got that working in Visual Basic.
Works a treat!!!

Now, if I clear the data in Cell A, the date stays in Cell B.

How do I clear this one.

Again Extreme thanks for the help.
This message was edited by virtual-bird on 2002-03-05 17:26
 
Upvote 0
select column B when you select your data in A and delete them at the same time, because this is in VBA it will put the date back in when you enter your data in A again
 
Upvote 0

Forum statistics

Threads
1,223,382
Messages
6,171,771
Members
452,422
Latest member
rlynchbro

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