upper case

B

bijan

Hi,experts
I am looking for a sample code to convert a range of lower case cells for
example (b2:b10) to upper case or define something to my userform textbox to
do that, any help would be appreciated
 
B

Bob Phillips

For Each cell In Range("B2:B10")

cell.Value = UCase(cell.Value)
Next cell

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

Rick Rothstein \(MVP - VB\)

This code snippet will do that...

Dim C As Range
........
........
For Each C In Range("B2:B10")
C.Value = UCase(C.Value)
Next


Rick
 
H

Harald Staff

Hi

Note that the .Value solutions will replace formulas with values. If that
may be a problem

C.Formula = UCase(C.Formula)

Also, here's a userform solution:

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
KeyAscii = Asc(UCase$(Chr(KeyAscii)))
End Sub

HTH. Best wishes Harald
 

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