(Solved) – How To Convert Date Format that’s being used to identify Activesheet?

  • by

I have a userform that’s being used to set up appointments and paste them into the month specific sheet.
What I need is for the full date (dd.mm.yy) to be pasted and not just the “MMM” date.

Private Sub Submit_Click()

If IsDate(DT.Text) Then

        DT.Text = Format(CDate(Me.DT.Text), "mmm") 'Format as abrivated month

        'Define and Assign worksheet and newRow variables
        Dim ws As Worksheet, newRow As Long
        Set ws = ThisWorkbook.Worksheets(Me.DT.Text)
        newRow = ws.Range("A" & Rows.Count).End(xlUp).Row   1
Dim dtnew As Long

dtnew = DT.NumberFormat = "dd.mm.yy"

    ws.Range("A" & newRow).Value = dtnew 'Adds the TextBox3 into Col A & Last Blank Row
    ws.Range("B" & newRow).Value = GroupName.Text
    ws.Range("D" & newRow).Value = Coordinator.Text
    ws.Range("E" & newRow).Value = Email.Text
    ws.Range("F" & newRow).Value = PhoneNumber.Text
    ws.Range("H" & newRow).Value = NumberPPL.Text

How can I get the date from DT.Text to paste as “dd.mm.yy” while still sorting the data into the correct worksheet?

Leave a Reply

Your email address will not be published. Required fields are marked *