I am building a userform that has the user input data and it will then transfer it to another sheet titled "Tracker." As part of the form, I am tagging all of the entries with the current date which I have in a textbox, but it will not appear until you run the form, click in the textbox and try to type something. Here is my code which will hopefully convey my project a little more clearly.
Private Sub CommandButton3_Click()
Dim LastRow As Long, ws As Worksheet
Set ws = Sheets("Tracker")
Sheets("Tracker").Select
LastRow = ws.range("A" & Rows.Count).End(xlUp).Row + 1 'Finds the last blank row
ws.range("A" & LastRow).Value = date_txtb.Text 'Adds the TextBox3 into Col A & Last Blank Row
ws.range("B" & LastRow).Value = ComboBox1.Text 'Adds the ComboBox1 into Col B & Last Blank Row
End Sub
Private Sub date_txtb_Change()
date_txtb.Text = Format(Now(), "MM/DD/YY")
End Sub
Command Button 3 transfers the data from the Userform to the "Tracker" sheet, and the sub below is the code for the textbox that is supposed to display the current date. What can I add or change to ensure that the date populates as soon as the form is initialized? Any help is appreciated, thanks!
LastRow = ws.range("A" & Rows.Count).End(xlUp).Rowshould beLastRow = ws.range("A" & ws.Rows.Count).End(xlUp).Row(note thews.beforeRows.Count). - PᴇʜPrivate Sub UserForm_Initialize()procedure in your userform? - Pᴇʜ