Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Date to Text conversion

Worked like a charm. thank you very much

--

Regards
Michael Koerner


"Michael Koerner" wrote in message
...
My bad, should have mentioned that I'm using 2007. will give you change a
shot. Thanks very much

--

Regards
Michael Koerner


"Dave Peterson" wrote in message
...
change this line:
myStr = .Text
to:
myStr = replace(.Text,"-"," ")

But replace was added in xl2k.

If you're using xl97 (or have to support it):
myStr = application.substitute(.Text,"-"," ")


Michael Koerner wrote:

Dave;

That worked. Now how do I replace the - with a space. when I do a search
and
replace, it changes the whole thing back into a dd-mmm-yy which is
different
from the original dd-mmm-yyyy sequence.

--

Regards
Michael Koerner

"Dave Peterson" wrote in message
...
Try:

Dim myRng As Range
Dim myCell As Range
Dim myStr As String

Set myRng = Selection
For Each myCell In myRng.Cells
With myCell
myStr = .Text
.NumberFormat = "@"
.Value = myStr
End With
Next myCell

Michael Koerner wrote:

Tried your solution. All I got in place of the dates was a bunch of
numbers.
Thanks

--

Regards
Michael Koerner

"Dave Peterson" wrote in message
...
Select the range to fix first:

Dim myRng as range
dim myCell as range

set myrng = selection
myrng.numberformat = "@"
for each mycell in myrng.cells
mycell.value = mycell.text
next mycell

.text is what you see in the cell (after formatting). If the column is
too
narrow, you could see ###'s and this will keep those ###'s--so be a
little
careful.

Michael Koerner wrote:

I have a sheet with a two columns containing dates. Sometimes it is
the
full
date as an example 25-Jul-1936, or Jul-1936 or 1936 I would like to
be
able
to convert that to text and maintain the same face value. Is that
possible
with some sort of macro?

--

Regards
Michael Koerner


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson



Reply
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
Text To Date Conversion John Calder New Users to Excel 2 March 9th 10 10:49 PM
Date to text conversion Toke Excel Discussion (Misc queries) 1 August 22nd 08 10:44 AM
Date to text conversion ginnyst Excel Discussion (Misc queries) 4 December 7th 07 03:32 PM
text to date conversion samuel Excel Worksheet Functions 3 August 17th 07 02:23 AM
Text Date Conversion CPodd Excel Discussion (Misc queries) 9 May 9th 07 04:39 AM


All times are GMT +1. The time now is 02:24 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"