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
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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
 

sadiq786k

New Member
Joined
Oct 5, 2011
Messages
24
HELLO vog THNKS ALOT THTS BEAUTIFUL ITS WORKING , I WILL NEED SMALL HELP MORE FROM YOU , I REALLY APPRECIATE THNKS HTH PETER
 

sadiq786k

New Member
Joined
Oct 5, 2011
Messages
24
But isthere any same function to be used without viewcode i mean with visual basic
just normal function to be enterd in cell
 

sadiq786k

New Member
Joined
Oct 5, 2011
Messages
24

ADVERTISEMENT

I mean without visual basic
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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.
 

sadiq786k

New Member
Joined
Oct 5, 2011
Messages
24
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,257
Messages
5,600,560
Members
414,388
Latest member
Pkmep4

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
Top