simple question

excel smurf

New Member
Joined
Aug 21, 2002
Messages
18
is there a way to capitalize text without retyping the text and without using the upper function? like perhaps a macro?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
like:

<pre>
Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub
</pre>
 
Upvote 0
Can't see why you'd want to do this but here you go ..

x = Cells(1, 1).Value
z = ""
For y = 1 To Len(x)
If (Asc(Mid(x, y, 1)) > 96 And Asc(Mid(x, y, 1)) < 124) Then
z = z & Chr(Asc(Mid(x, y, 1)) - 32)
Else
z = z & Mid(x, y, 1)
End If
Next

Cells(2, 1).Value = z
 
Upvote 0
ASAP utilities is another add-in that you can download - it contains an option for converting a range of cells to upper case, lower case, proper, etc. - in addition it has many other utilities that I have found to be very useful. You can download it for free at

http://www.asap-utilities.com

HTH
kevin
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,175
Members
449,071
Latest member
cdnMech

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