How do I create a macro the capitalizes an entire excel sheet?

P

Poohberry

I have to import data regularly and then capitalize it. How do I create a
macro the capitalizes an entire excel sheet?
 
G

Gary''s Student

Sub capall()
For Each r In ActiveSheet.UsedRange
r.Value = UCase(r.Value)
Next
End Sub
 
B

Bill Kuunders

One way
without a macro

Assuming your text is in sheet1

Start with a new blank sheet
enter =upper(sheet1!A1) in A1 and extend it accross and down as far as you
need to.
 
M

Mike H

And another way that ensures formula aren't turned into values

Sub capall()
For Each r In ActiveSheet.UsedRange
r.Formula = UCase(r.Formula)
Next
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top