Today's Date Auto Fill in Userform Text box

MikeeRDX

Board Regular
Joined
Feb 16, 2014
Messages
98
Hi, is it possible to create a code to have a text box auto fill with today's date as soon as the user form is opened? Thank you!
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,804
Office Version
  1. 365
Platform
  1. Windows
Add this in the form's Initialize event, change the textbox name if needed.
Code:
TextBox1.Value = Date
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,306
Office Version
  1. 2010
Platform
  1. Windows
Hi, is it possible to create a code to have a text box auto fill with today's date as soon as the user form is opened? Thank you!

Assuming the TextBox is named TextBox1, this UserForm Initialize event code will do that...
Code:
Private Sub UserForm_Initialize()
  TextBox1.Value = Date
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,108,492
Messages
5,523,260
Members
409,506
Latest member
reneekeane

This Week's Hot Topics

Top