ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert cells to uppercase (https://www.excelbanter.com/excel-programming/424340-convert-cells-uppercase.html)

Fan924

Convert cells to uppercase
 
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

Don Guillett

Convert cells to uppercase
 

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.row100 or target.column<1 then exit sub
target.Value = UCase(target)
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fan924" wrote in message
...
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



Fan924

Convert cells to uppercase
 
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.

Don Guillett

Convert cells to uppercase
 
You are talking about a worksheet_change event then. So delete the selection
part

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fan924" wrote in message
...
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.



Fan924

Convert cells to uppercase
 
Thanks Don, works great.

Don Guillett

Convert cells to uppercase
 
Glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fan924" wrote in message
...
Thanks Don, works great.




All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com