+ Reply to Thread
Results 1 to 2 of 2

VBA - Userform - DT picker not showing today date by default

  1. #1
    Registered User
    Join Date
    10-16-2019
    Location
    Canada
    MS-Off Ver
    Microsoft Office Professional plus 2016
    Posts
    1

    Angry VBA - Userform - DT picker not showing today date by default

    Hello, below is the code for my userform. My users want to have today date as default but I can't make it happen. Help!!! PLS

    Private Sub CommandButton1_Click()

    Dim TargetRow As Integer

    TargetRow = Sheets("Engine").Range("B3").Value + 1

    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 1).Value = DTPicker1
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 2).Value = DTPicker2
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 3).Value = ComboBox1
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 4).Value = ComboBox2
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 5).Value = ComboBox3
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 6).Value = ComboBox4
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 7).Value = ComboBox5
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 8).Value = ComboBox6
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 9).Value = TextBox1
    Sheets("Sheet1").Range("Data_Start").Offset(TargetRow, 10).Value = TextBox2
    Unload Me
    MsgBox "Data was added to the tracker", 0, "Complete"
    UserForm1.Show

    End Sub


    Private Sub CommandButton2_Click()

    Unload UserForm1

    End Sub

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA - Userform - DT picker not showing today date by default

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Date and Time picker (default values)
    By Mahmoudelnemr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2019, 11:09 AM
  2. [SOLVED] Date picker-Need it to default to today's date. Also getting error but it seems to work.
    By aliciaward1001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2017, 12:56 PM
  3. [SOLVED] Date Picker Default Value
    By jeetkapadia in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-02-2017, 03:13 PM
  4. [SOLVED] Date picker calendar on userform showing Error
    By Anisusa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2017, 12:23 PM
  5. [SOLVED] Date picker - must not be more that 6 yrs from today
    By AuntyJean in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2015, 10:33 AM
  6. Date picker UserForm to stay always in front of the main UserForm
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2014, 07:31 AM
  7. Userform: Calender to open with today's date as default
    By Ashali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2012, 07:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1