Convert cells to uppercase

F

Fan924

I have been using this for a while. Converts characters in cells to
uppercase. I am trying to expand it to cells A1 to A100.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Range("A2").Value = UCase(Range("A2").Value)
Range("A11").Value = UCase(Range("A11").Value)
End Sub
 
D

Don Guillett

If???? you want to do it by selecting any cell in that range, try this.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
if target.row>100 or target.column<>1 then exit sub
target.Value = UCase(target)
End Sub
 
F

Fan924

It does not work that well. If I enter a value of "af" and leave the
cell, nothing. When I revisit the cell, then it will change the cell
to "AF". My previous attempt changes to uppercase as I leave the cell.
 
D

Don Guillett

You are talking about a worksheet_change event then. So delete the selection
part
 

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