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: 343
Default Mixed format

Cell U23 has both text and time in it. What I was hoping was that the code
below would change the text to all caps and the number to a time format.


Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ErrHandler:

Application.EnableEvents = False

If Target.Count = 1 And Not Application.Intersect( _
Me.Range("U23"), Target) Is Nothing Then
If IsNumeric(Target.Value) And InStr(Target.Value, ":") = 0 _
And Len(Target.Value) < 5 Then
Target.Value = Format$(Target.Value, "'00\:00")
Else
Target.Value = UCase$(Target.Value)
End If
End If

ErrHandler:

Application.EnableEvents = True

End Sub

 
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
Mixed 3D Charts Mark Ivey Charts and Charting in Excel 1 October 5th 06 08:12 PM
format painter wont copy mixed font colors from one cell to next dgc49 Excel Discussion (Misc queries) 6 June 9th 06 01:35 AM
Mixed Cell prbucci Excel Worksheet Functions 2 January 13th 06 03:04 AM
A mixed request Con[_4_] Excel Programming 2 September 12th 05 03:41 AM
A mixed bag of questions Chip Pearson Excel Programming 2 September 13th 03 05:45 PM


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

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"