Is there an easy way to make all text in excel (97) into upper case?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Upper Case
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Upper Case
- This topic has 10 replies, 5 voices, and was last updated 24 years, 4 months ago.
Viewing 1 reply threadAuthorReplies-
WSJanet
AskWoody LoungerJanuary 3, 2001 at 8:13 pm #508753Go to a blank sheet and use the “UPPER” formula in cell A1 -linking it to cell A1 on the sheet you want to convert. Autofill the entire workbook – and you will have a copy in upper case…but you’re not finished yet. Copy and paste this sheet using paste special > value only > to another sheet – this will eliminate the cells being a formula and give you text only.
-
WSSteveB
AskWoody Lounger
-
WSgwhitfield
AskWoody LoungerJanuary 3, 2001 at 10:20 pm #508768Steve,
A quick and nasty way is to use Word.
.Highlight the cells in Excel
.Copy them
.Paste them into Word
.Highlight the resulting table
.Press Shift+F3 several times until the letters are all upper case
.Copy
.Paste back into ExcelIf you’re going to do it frequently though I’d write a macro. Is this a one-off only?
Geoff
-
WSSteveB
AskWoody Lounger -
WSgwhitfield
AskWoody LoungerJanuary 3, 2001 at 11:07 pm #508774Hi,
From Excel, press Alt + F11 to get into the VB editor. Clcik on “This Workbook” in the “project explorer” window in the top left. Select Insert, Module. paste this code in:
Option Explicit
Sub ConvertToUpper()
Dim i As Integer
Dim j As Integer
Dim rng As RangeSet rng = Selection
For i = 1 To rng.Rows.Count
For j = 1 To rng.Columns.Count
rng(i, j).Value = UCase$(rng(i, j).Value)
Next
NextEnd Sub
You can now run it by selecting the cells you want converted, then Tools, Macros, Macros, selecting “ConvertToUpper” and Run.
You can also assign it to a custom button. Tools, Customize, select the “Commands” tab (if it isn’t already), scroll down on the left to select macros. There’s a custom button there- drag that onto the toolbar. Then right click on the button, and select the “Assign to macro”.
I’ve probably left out a step or 2, but that’s the gist of it.
This will put the macro and button into the current worksheet. To make it available to all worksheets, you’ll probably want to create the worksheet as an add-in. That’s something I haven’t done myself, so I’m not quite sure. I’ll leave somebody else more knwledgeable to do that.
Geoff
-
WSdcardno
AskWoody LoungerJanuary 4, 2001 at 5:23 am #508816Geoff Whitfield suggested looping through the rows and columns in the selected range and substituting the UCase(text) for text in each cell.
I think the approach is right, but runs into problems if the selected range does not start at A1, or is not a rectangular section of the s/sheet, I would think.
I would suggest:
****
Option ExplicitSub ConvertToUpper()
Dim Rng As Range
Dim Cell As RangeSet Rng = Selection
For Each Cell In Rng
If Not IsNumeric(Cell.Value) Then Cell.Value = UCase$(Cell.Value)
Next CellEnd Sub
****The test for a numeric value is just to avoid overwriting formulas with their value equivalents. Unfortunately I couldn’t find an equivalent “IsString” function, so I had to use the negation of the numeric test – there could be other values that you would want to avoid overwriting.
-
WSdcardno
AskWoody LoungerJanuary 4, 2001 at 5:29 am #508818Just like the old carpenter’s rule, “measure twice – cut once” I must remember to read twice, post once!
First, there is no need for the “Rng” variable in my last bit of code – it will work perfectly well by using:
For Each Cell in Selection…
and probably a microsecond faster, too!
Second, Geoff left open the question of how to make the macro available to all workbooks. Create it in your personal macro workbook, and if you are going to use it a lot, assign it to a (new) button on a toolbar. It will always be available to *you*, even if not to other users.
-
WSgwhitfield
AskWoody LoungerJanuary 4, 2001 at 8:06 am #508830Hi,
My experience using “selection” has been in Word. In most cases there. It has been more efficient to set a range option- the selection object in most cases slows processing down for large selections drastically. The range object does not refresh the screen display like the selection object does.
If there’s a large selection, and this was REALLY important to code efficiently, I’d assign the output to an array, then at the end set the range back to the value of the array.
When I was setting up a large range, and inserting values cell by cell, the response became extremely slow after a certain number of columns. I found that setting an array to the size of the selection, assigning the formula/value of each cell to the array, and then setting the range to the array, improved the response by 95%.
Thanks for the reminder about “for each cell”. I’d forgotten that I needed to define “cell” as a range.
But then, it was a quick and dirty after all. Of course, I purposely left it up to other loungers to clean up the code!
Geoff
-
WSTomG
AskWoody LoungerJanuary 4, 2001 at 7:28 am #508823I suggest the following revision to your code. If someone has created a logical formula that puts text in the cell for true or false, your code will overwrite their formula with the uppercase text result of the formula. (I would also add error handling if the macro was run on a selected chart or drawn object.)
For example, if I said If(G2>40,”ot”,””) to say if the hours in cell G2 are greater than 40 then put ot in the cell, then the formula would have been overwritten with OT from your previous code, since IsNumeric would be false.
The code below skips the cell if it contains a formula.
Sub ConvertToUpper() On Error GoTo errConvertToUpper Dim Cell As Range For Each Cell In Selection If Not Cell.HasFormula Then Cell.Value = UCase(Cell.Value) Next Cell exitConvertToUpper: Exit Sub errConvertToUpper: If Err.Number = 438 Then MsgBox "You probably don't have cell(s) selected", vbExclamation, "Selection Alert" Resume exitConvertToUpper End If MsgBox Err.Number & " " & Err.Description Resume exitConvertToUpper End Sub
-
WSdcardno
AskWoody Lounger
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
1 hour, 14 minutes ago -
Where’s the cache today?
by
Up2you2
16 hours, 35 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
9 hours, 20 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
19 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
17 hours, 16 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
1 day, 9 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 day, 9 hours ago -
regarding april update and may update
by
heybengbeng
1 day, 11 hours ago -
MS Passkey
by
pmruzicka
13 hours, 21 minutes ago -
Can’t make Opera my default browser
by
bmeacham
1 day, 19 hours ago -
*Some settings are managed by your organization
by
rlowe44
1 day, 5 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day, 17 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
2 days, 13 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
2 days, 22 hours ago -
AI slop
by
Susan Bradley
16 hours, 36 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
2 days, 23 hours ago -
Two blank icons
by
CR2
8 hours, 9 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
10 hours, 7 minutes ago -
End of 10
by
Alex5723
3 days, 11 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 days, 9 hours ago -
test post
by
gtd12345
3 days, 17 hours ago -
Privacy and the Real ID
by
Susan Bradley
3 days, 7 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 10 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
3 days, 21 hours ago -
Upgrading from Win 10
by
WSjcgc50
2 days, 9 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
2 days, 13 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
4 days, 13 hours ago -
The story of Windows Longhorn
by
Cybertooth
4 days, 1 hour ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
4 days, 15 hours ago -
Are manuals extinct?
by
Susan Bradley
1 day, 15 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.