Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro Format Problem

Status
Not open for further replies.

garvock

Technical User
Jan 22, 2004
16
GB
I recorded this macro in Excel to convert dates in column A(23/4/04) to text as the file is linked to an Access database and the dates appear as a number, i.e. 38100.
The macro works OK but converts the text from 23/4/04 to 4/23/2004(the cell format changes to text OK).
How can I do this properly. I want the text to show as 23/4/04 in the Access report.
------------------------------------------------------------
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 2)
Range("C1").Select
End Sub

------------------------------------------------------------
Hope you experts out there can help this novice.
Thanks Keith

 
Have you tried something like this ?
Format(Range("A1"), "dd/mm/yyyy")


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Keith,

I am having trouble understanding your problem.

You have dates in Excel. BTW, Dates are only NUMBERS like 38100 in BOTH Excel and ACCESS.

Your problem is one of FORMATTING in Access.
[tt]
Format([MyDateField], "m/d/yy")
[/tt]
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top