Hi Gurus
Currently I have a userform whereby the first textbox require to enter the week number and below two text boxes will display the date of the week number enter.
Currently I have the code to initialize the date according to system, but I would it initialize according to the week number entered in text box.
Please refer the code below.
Private Sub btnSubmit_Click()
Dim DataLog As Worksheet
Set DataLog = ThisWorkbook.Sheets("Datalog")
DataLog.Cells(1, 1) = Me.tbWeekBox
DataLog.Cells(1, 2) = Me.tbDate1
DataLog.Cells(1, 3) = Me.tbDate2
End Sub
Private Sub UserForm_Initialize()
Me.tbDate1 = Me.tbWeekBox + Format(DateAdd("D", -Weekday(Date), Date), "dd-mmm-yy")
Me.tbDate2 = Me.tbWeekBox + Format(DateAdd("D", -Weekday(Date) + 1, Date), "dd-mmm-yy")
End Sub
It seems not to be working
Bookmarks