Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 7
Default UpperCase changes date format

I have a very unusual problem with the below code, which for some reason changes the date format on all cells in my spreadsheet from dd/mm/yyyy to mm/dd/yyyy. I tried to solve it but not luck with If x.Value = IsDate(x.Value) Then Exit Sub



Sub Uppercase()

Application.ScreenUpdating = False


' Loop to cycle through each cell in the specified range.
Set URange = Selection
For Each x In URange
' Change the text in the range to uppercase letters.
x.Value = UCase(x.Value)

If x.Value = IsDate(x.Value) Then Exit Sub

Next

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default UpperCase changes date format

MrPetreli formulated the question :
I have a very unusual problem with the below code, which for some reason
changes the date format on all cells in my spreadsheet from dd/mm/yyyy
to mm/dd/yyyy. I tried to solve it but not luck with If x.Value =
IsDate(x.Value) Then Exit Sub



Try...

Sub Uppercase()
Application.ScreenUpdating = False
Dim x As Range
For Each x In Selection
If Not IsDate(x.Value) Then x.Value = UCase(x.Value)
Next 'x
Application.ScreenUpdating = True
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
custom format - month as uppercase Glen Excel Discussion (Misc queries) 2 March 13th 07 12:21 AM
Need an UPPERCASE format ability in Excel just like Word Ron Lehr Excel Discussion (Misc queries) 10 January 25th 07 05:06 AM
How to format cells for uppercase entry CoDer New Users to Excel 3 August 12th 06 03:05 AM
Format cell to uppercase using code Pat Excel Programming 5 February 12th 05 11:50 PM
Excel Date in uppercase Steve J. Vaughan Excel Worksheet Functions 9 December 15th 04 03:25 PM


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