PC Review


Reply
Thread Tools Rate Thread

Date parsing - how to get same result from different input types?

 
 
New Member
Join Date: Jun 2009
Posts: 2
 
      24th Jun 2009
Hi guys,

I have many kinds of date types as an input for parsing and many international settings where this macro has to run.
E.g. date can be put as "24-03-2009" or "16-aug-09" or whatever and default date setting on user's computer can not be predicted.

Need to parse a date and always get the result in one specific format, chosen by myself.
It has to be independent on MY excel date settings and I can not change the source sheet.

I can use value2 to get the "absolute value" of the date but I need to retype it back to date before the parsing.

How can I make vba to STORE the date (in a variable not connected to any cell on the sheet) in specific format for the parsing purposes?

Thank you, any idea is much appreciated.
Zuzana
 
Reply With Quote
 
 
 
 
New Member
Join Date: Jun 2009
Posts: 2
 
      25th Jun 2009
So that's the solution:

(dateToBeParsed as string)

dateToBeParsed = sourceCell.Value
dateToBeParsed = Format(dateToBeParsed, "dd/mm/yyyy")

now the dateToBeParsed is in my format.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
input vs. result amy howell Microsoft Excel Misc 4 18th Mar 2008 01:35 PM
Line Input and Parsing. =?Utf-8?B?Qm9iIEJhcm5lcw==?= Microsoft Access 4 1st Sep 2006 10:24 PM
Parsing user input from a textbox in vb.net Paulers Microsoft VB .NET 0 3rd Feb 2006 02:48 PM
Parsing date from sql string in asp.net, then comparing it with present date .Net Sports Microsoft VB .NET 1 25th Jun 2005 08:38 AM
Parsing date from sql string in asp.net, then comparing it with present date .Net Sports Microsoft ASP .NET 1 25th Jun 2005 12:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:23 PM.