Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Change MM/DD/YYYY to MM.DD.YYYY

Does some kind soul have a macro to change MM/DD/YYYY to MM.DD.YYYY .

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Change MM/DD/YYYY to MM.DD.YYYY

Hi,

No need for a macro ...
Just Format Custom
and type your format mm.dd.yyyy

HTH
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Change MM/DD/YYYY to MM.DD.YYYY

Thanks Carim ...

I need a VBA solution that works on a String.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Change MM/DD/YYYY to MM.DD.YYYY

If you dealing with normal text, go ahead with
Sub Macro1()
ActiveCell.Replace What:="/", Replacement:=".", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Cells.Find(What:="/", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False) _
.Activate
End Sub

HTH
Cheers
Carim

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Change MM/DD/YYYY to MM.DD.YYYY

Sub ee()
Dim sStr As String, sStr1 As String
sStr = "01/18/2006"
MsgBox sStr
sStr1 = Replace(sStr, "/", ".")
MsgBox sStr1
End Sub

--
Regards,
Tom Ogilvy

" wrote:

Thanks Carim ...

I need a VBA solution that works on a String.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change MM/DD/YYYY to MM.DD.YYYY

The easiest way is to use the Text() Function.. in pure Excel you would
just do

Text("10/12/1984", "mm.dd.yyyy")

So to run it in VB, do this:

Application.Worksheetfunction.Text("10/12/1984", "mm.dd.yyyy")

Easy one liner

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Change MM/DD/YYYY to MM.DD.YYYY

I went with the easy one liner.

I hadn't seen Application.Worksheetfunction before so that made the
solution especially sweet.

Thanks also to Carim.

You guys make the internet great!

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
change date format from dd/mm/yyyy to mm/yyyy flow23 Excel Discussion (Misc queries) 3 April 4th 23 11:26 AM
Formula bar shows mm/dd/yyyy. To show dd/mm/yyyy. How? magna Excel Discussion (Misc queries) 2 January 1st 08 08:14 AM
how do I change date from mm/dd/yyyy to dd:mm:yyyy format in Excel Jack Wilson New Users to Excel 4 July 18th 06 01:57 PM
change birthday display from mm/dd/yyyy to HIDE the yyyy? johnp Excel Worksheet Functions 1 May 9th 06 09:56 PM
opening excel file - date format problem: DD/MM/YYYY vs MM/DD/YYYY yung Excel Programming 2 March 18th 05 12:50 PM


All times are GMT +1. The time now is 11:05 AM.

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

About Us

"It's about Microsoft Excel"