none
regarding how can viewing the date formt inside textbox as it without changing format RRS feed

  • Question

  • dears

    good greeting

    i want  from the textbox inside userform to appear the georgian date or hijrian date as it when it import the date from the excel sheetdon't change it's date format 

    Wednesday, February 28, 2018 11:32 AM

Answers

  • Read the number format of the cell from which the date is being imported and then use Format function to display the date same as the source.

        Dim strNumbFormat As String
       
        strNumbFormat = Worksheets("Sheet1").Range("A3").NumberFormat
       
        Me.TextBox1.Value = Format(Worksheets("Sheet1").Range("A3"), strNumbFormat)


    Regards, OssieMac

    • Marked as answer by TAREK SHARAF Monday, March 12, 2018 7:27 AM
    Tuesday, March 6, 2018 1:54 AM

All replies

  • Read the number format of the cell from which the date is being imported and then use Format function to display the date same as the source.

        Dim strNumbFormat As String
       
        strNumbFormat = Worksheets("Sheet1").Range("A3").NumberFormat
       
        Me.TextBox1.Value = Format(Worksheets("Sheet1").Range("A3"), strNumbFormat)


    Regards, OssieMac

    • Marked as answer by TAREK SHARAF Monday, March 12, 2018 7:27 AM
    Tuesday, March 6, 2018 1:54 AM
  • dear terry

    thanks too much it worked now well

    accept my greeting

    Monday, March 12, 2018 7:27 AM