What is a formula for a set time and one for date that doesn't change?

Caveman1964

Board Regular
Joined
Dec 14, 2017
Messages
127
Office Version
  1. 2016
Platform
  1. Windows
I have a formula to put a time and time in a cell but it changes every time I do something in the spreadsheet.
looking for one that does static time and date and also formula that does static date and time separately.
Anybody know how to do this?
appreciate any help!
Thanks!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
It's not a formula, but I gather you can input the current date and time into a cell using the two keyboard shortcuts ctrl+: and ctrl+;
 
Upvote 0
It's not a formula, but I gather you can input the current date and time into a cell using the two keyboard shortcuts ctrl+: and ctrl+;

yeah I was wanting to make a macro to do it so they could just click a button. I did not describe that well in my post. Thanks for replying!
 
Upvote 0
This will put today's date in A1 & the date & time in B1
Code:
Sub DateNTime()
   Range("A1").Value = Date
   Range("B1").Value = Now()
End Sub
 
Upvote 0
This will put today's date in A1 & the date & time in B1
Code:
Sub DateNTime()
   Range("A1").Value = Date
   Range("B1").Value = Now()
End Sub

Thank You!
appreciate you spending the time to do that!
Have a good weekend.
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0
This will put today's date in A1 & the date & time in B1
Code:
Sub DateNTime()
   Range("A1").Value = Date
   Range("B1").Value = Now()
End Sub
Just to add one more, here is for the time only...

Range("C1").Value = Time
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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