ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert text to all caps (https://www.excelbanter.com/excel-programming/418268-convert-text-all-caps.html)

Patrick C. Simonds

Convert text to all caps
 
Is there any way to convert all text, in the range B3:M2500, to all capital
letters from within a macro?


Mike H

Convert text to all caps
 
Hi,

Right click your sheet tab, view code and paste this in and run it

Sub standard()
Set myrange = Range("B3:M2500")
For Each c In myrange
c.Formula = UCase(c.Formula)
Next
End Sub

Mike

"Patrick C. Simonds" wrote:

Is there any way to convert all text, in the range B3:M2500, to all capital
letters from within a macro?



DMoney

Convert text to all caps
 
Sub tst()
Dim rng As String
Range("b3").Select
Nex:
Do Until ActiveCell.Row = 2501
col = Mid(ActiveCell.Address, 2, 1)
rng = ActiveCell.Value
ActiveCell.Value = UCase(rng)
ActiveCell.Offset(1, 0).Activate
Loop
ActiveCell.Offset(-2498, 1).Activate
If col = "N" Then End
GoTo Nex

End Sub


"Patrick C. Simonds" wrote:

Is there any way to convert all text, in the range B3:M2500, to all capital
letters from within a macro?



Richard Schollar[_2_]

Convert text to all caps
 
Hi Patrick

For Each c in
Range("B3:M2500").SpecialCells(xlCellTypeConstants ,xlTextValues)
c.Value = UCase(c.Value)
Next c


Richard


"Patrick C. Simonds" wrote in message
...
Is there any way to convert all text, in the range B3:M2500, to all
capital letters from within a macro?



Mike H

Convert text to all caps
 
Hi,

I hope there are no formula in the range, if there are this converts them to
values.

Mike

"dmoney" wrote:

Sub tst()
Dim rng As String
Range("b3").Select
Nex:
Do Until ActiveCell.Row = 2501
col = Mid(ActiveCell.Address, 2, 1)
rng = ActiveCell.Value
ActiveCell.Value = UCase(rng)
ActiveCell.Offset(1, 0).Activate
Loop
ActiveCell.Offset(-2498, 1).Activate
If col = "N" Then End
GoTo Nex

End Sub


"Patrick C. Simonds" wrote:

Is there any way to convert all text, in the range B3:M2500, to all capital
letters from within a macro?




All times are GMT +1. The time now is 12:22 AM.

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