text in caps

G

Guest

Guest
I want what to make sure the text in column E is caps how can this be done? Thanks
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Sheet was e-mailed to me did not work, I don’t know what is happening! it is suppose to change what is typed in column E to caps right? Using Excel ’97. Again thanks for the help. Now I am very :confused:
 
Upvote 0
I also did everything posted and security is set to medium. I'm using Excel 2000 and it does not work for me either.
 
Upvote 0
Try the following. Formulas usually will automatically change to uppercase, and the parts that don't you usually don't want to make uppercase anyway (let me know if anyone can think of a reason for this). Hope this helps,

-Russell<pre><font color='#000000'><hr align=left width=500><font color='#000080'>Private</font><font color='#000080'>Sub</font> Worksheet_Change(ByVal Target<font color='#000080'>As</font> Range)<font color='#000080'>On</font><font color='#000080'>Error</font><font color='#000080'>GoTo</font> HandleErr<font color='#000080'>Dim</font> cell<font color='#000080'>As</font> Range

Application.EnableEvents = False<font color='#000080'>For</font><font color='#000080'>Each</font> cell In Target<font color='#000080'>If</font> cell.Column = 5<font color='#000080'>Then</font><font color='#000080'>If</font> cell.Formula = ""<font color='#000080'>Then</font>
cell.Text = UCase(cell.Text)<font color='#000080'>End</font><font color='#000080'>If</font><font color='#000080'>End</font><font color='#000080'>If</font><font color='#000080'>Next</font> cell

ExitHere:
Application.EnableEvents = True<font color='#000080'>Exit</font><font color='#000080'>Sub</font>
HandleErr:
MsgBox Err.Description
Resume ExitHere<font color='#000080'>End</font><font color='#000080'>Sub</font></font></pre>
This message was edited by Russell Hauf on 2002-02-27 13:03
 
Upvote 0

<<<
Correction. Better make that :-

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng1 As Range, rng2 As Range, cell As Range
Application.EnableEvents = False
If Not Intersect(Selection, Columns(5)) Is Nothing Then
Set rng1 = Intersect(Selection, Columns(5))
Set rng2 = Intersect(ActiveSheet.UsedRange, rng1)
For Each cell In rng2
If cell.Formula <> "" Then
cell.Formula = Format(cell.Formula, ">")
End If
Next cell
End If
Application.EnableEvents = True
End Sub
>>>


Setting rng1 as the intersection of "selection" and the affected column has an unexpected result - it only affects the cell below the changed cell. By setting rng1 = columns (x) you won't miss any cells.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,591
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top