LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Date from string

I have a unique problem. When I export a report from a program, the dates
are formatted as mm/dd/yyyy:
09/01/2008

When other users export the same report from the same program, the dates are
formatted as m/d/yyyy:
9/1/2008

I don't know if it's an Excel issue, Windows or even the source program, but
that's not important.

The export has cell B3 with this value (on my machine):
09/01/2008 to 09/30/2008

When I go into a macro with the following line:
Message = MsgBox(InStr(1, "B3", " to "), vbOKOnly, "test")
I get a dialog box with "0"

This makes no sense...when I use the Find function in the spreadsheet it
works:
=FIND(" to ",B3,1) Returns 11

I'm trying to find a way in the VB code to account for the different date
formats...if I can find where " to " starts, I can trim the value. I need
the value to determine a name for the file based on it's contents.

Thanks!!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Date string to date format Joe M. Excel Discussion (Misc queries) 7 May 6th 10 02:46 PM
VBA convert day and date from text string to Excel date Max Bialystock[_2_] Excel Programming 5 May 14th 07 04:54 AM
Is the string a date? [email protected] Excel Programming 4 November 9th 06 05:44 AM
changing a string date into a 'date' DowningDevelopments Excel Programming 4 December 9th 05 05:00 PM
Converting a string date into a Excel Date Phillips Excel Programming 0 November 24th 03 08:54 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"