LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Forcing to Uppercase

Quite some time ago I posted a question on this database regarding 'forcing
uppercase' and was given two macros, which I've used time and time again:
one to force the entire worksheet to uppercase and the other one was to
select just certain ranges to be uppercase, no matter how they were typed.
Neither one of the macros is quite right for what I need now. I need a macro
for just one cell.

Here's the macro I have to force the entire worksheet to uppercase:

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
.Value = UCase(.Value)
End If
End With
End Sub

This is the macro I have to force certain ranges to upper case:

Private Sub Worksheet_Change(ByVal Target As Range)
if target.cells.count 1 then exit sub
If Not (Application.Intersect(Target, Range("B18:B100,F18:F100")) Is
Nothing) _
Then
With Target
If Not .HasFormula Then
application.enableevents = false
.Value = UCase(.Value)
application.enableevents = true
End If
End With
End If
End Sub

How do I modify either macro to be just one cell?

Connie
 
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
Forcing SaveAs to new name Rob Excel Discussion (Misc queries) 2 December 3rd 06 05:14 AM
Forcing an entry [email protected] Excel Discussion (Misc queries) 3 October 19th 06 10:04 PM
Forcing Text Kirk P. Excel Discussion (Misc queries) 2 September 26th 06 07:57 PM
forcing UDF to run Stefi Excel Worksheet Functions 4 December 29th 05 03:46 PM
Forcing a font throughout mattslav Excel Discussion (Misc queries) 3 June 8th 05 06:50 PM


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