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
 
Top