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, 3 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
-
W11 23H2 April Updates threw ‘class not registered’ (Awaiting moderation)
by
WindowsPersister
9 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
4 hours, 32 minutes ago -
two pages side by side land scape
by
marc
1 day, 3 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
1 day, 5 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
8 hours, 48 minutes ago -
Security Essentials or Defender?
by
MalcolmP
11 hours, 32 minutes ago -
April 2025 updates out
by
Susan Bradley
2 hours, 1 minute ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
4 hours, 54 minutes ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
3 hours, 48 minutes ago -
Creating an Index in Word 365
by
CWBillow
21 hours, 30 minutes ago -
Coming at Word 365 and Table of Contents
by
CWBillow
12 hours, 58 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
2 days ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
2 days, 4 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
2 days, 6 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
2 days, 4 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
1 day, 21 hours ago -
I installed Windows 11 24H2
by
Will Fastie
3 hours, 50 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
2 days, 9 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
9 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
2 days, 17 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
2 days, 2 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
2 days, 2 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
3 days, 10 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
3 days, 19 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
2 days, 21 hours ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
3 days, 3 hours ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
3 days, 14 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
5 days, 6 hours ago -
50 years and counting
by
Susan Bradley
2 days, 4 hours ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
2 days, 7 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.