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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Text

Status
Not open for further replies.

Adams

Technical User
Mar 10, 2001
44
US
I need help with a macro in Excel. I have a column with string of text
Thu 4/1/04 2:48 PM and I need to delete the first 4 positions in each row in the column. End result: 4/1/04 2:48 PM

Do I use LTrim?
 
Adams,

Are you sure that it's TEXT?

Select one of these cells, Format/Cells - Number Tab -- and tell me what the FORMAT is.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
If it's allways 4 characters, this will work:

Mid(MyString,5,len(MyString))

However, it you're using all dates, why not format the cell correctly?

Selection.NumberFormat = "m/d/yy h:mm AM/PM"

calculus
 
touche!

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Since its formatted General and NOT Date, it's just TEXT. Use calculus' suggestion.

BTW, I would STRONGLY recommend that you do NOT leave the results as TEXT. Rather CONVERT the TEXT to DATE. Date/Time is a NUMBER that is FORMATTED to represent a number of Date and Time formats. Like Now is 38141.33487 which can be FORMATTED, for instance, Thu June 03, 2004 or any number of DIFFERENT ways.

:)



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