Date button

teamsimpson

New Member
Joined
Sep 20, 2002
Messages
22
On top of my worksheet i have a title DATE,i type the date in manually next to it. I just wondered if there was a simple macro i could write which , on picking the DATE it would insert the current date.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I must be thick, Andrew when i type in Ctrl+;
nothing happens, i even put an = infront.do you mean the Ctrl key, what should i type in to make it work ?
 
Upvote 0
Thanks, i took it literally what you wrote.
if i wanted a control button named DATE, so soon as it was pressed it wrote the current date in the adjacent right cell, whatmacro code should i write ?
 
Upvote 0
Assuming your command button is from the Control Toolbox and it's named CommandButton1:

Code:
Private Sub CommandButton1_Click()
'   ** Change range address to suit **
    ActiveSheet.Range("A1").Value = Date
End Sub
 
Upvote 0

Forum statistics

Threads
1,225,071
Messages
6,182,679
Members
453,132
Latest member
nsnodgrass73

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