• Date Format a column in code (2000/SP3)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Date Format a column in code (2000/SP3)

    Author
    Topic
    #396120

    I want to format column “I” on my spreadsheet in vbShortDate format, but keep getting various error messages. The code should be something like the following (I think):
    With ws
    With .Range(“I1”)
    .EntireColumn.Format vbShortDate ‘ – Not correct!!
    End With
    End With

    Would appreciate guidance on what the correct text should be – I do not have my Excel coding text books handy, and the Help file has not helped!

    TIA

    Kiwi44

    Viewing 1 reply thread
    Author
    Replies
    • #739919

      Recording a macro is a good way to find out.

      .EntireColumn.NumberFormat = “m/d/yyyy”

      Note: although this looks like a specific US date format, it will be translated to whatever has been set as the short date format on the user’s system. On my PC, it results in dd-mm-yyyy since that is my short date format.

    • #739920

      Recording a macro is a good way to find out.

      .EntireColumn.NumberFormat = “m/d/yyyy”

      Note: although this looks like a specific US date format, it will be translated to whatever has been set as the short date format on the user’s system. On my PC, it results in dd-mm-yyyy since that is my short date format.

    Viewing 1 reply thread
    Reply To: Date Format a column in code (2000/SP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: