Now funtion or today function ?

sadiq786k

New Member
Joined
Oct 5, 2011
Messages
24
Hello i m using scanning barcode in excel
so i m looking for small function for date & time with secs
but it should be when any data is entered in a1 a2 a3 a4 a5
so next in b1 b2 b3 b4 b5 should display date & time with secs
but it should work only if a data is entered
what is the best function to be used
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try this: right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
    Application.EnableEvents = False
    With Target.Offset(, 1)
        .Value = Now
        .NumberFormat = "dd/mm/yyyy hh:mm:ss"
    End With
    Application.EnableEvents = True
End If
End Sub
 
Upvote 0
HELLO vog THNKS ALOT THTS BEAUTIFUL ITS WORKING , I WILL NEED SMALL HELP MORE FROM YOU , I REALLY APPRECIATE THNKS HTH PETER
 
Upvote 0
But isthere any same function to be used without viewcode i mean with visual basic
just normal function to be enterd in cell
 
Upvote 0
If you use the formula

=IF(A1="","",NOW())

that value will change every time the worksheet calculates, so it will not be a static value.

to get a static value you can press CTRL + ; for date and CTRL + : for time, but that is not automatic.

So, you really need VBA.
 
Upvote 0
I m looking to programm my excel file

hello I have a file which i want to programm this file , but i dont know how to attach on this forum , plz assist me
 
Upvote 0

Forum statistics

Threads
1,214,525
Messages
6,120,051
Members
448,940
Latest member
mdusw

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