upper case

  • Thread starter Thread starter bijan
  • Start date Start date
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
 
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)
 
This code snippet will do that...

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


Rick
 
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
 
Back
Top