Asked By
anonymous
7060 points
N/A
Posted on - 04/15/2011
Excel macro or script that can make all data into caps in a excel sheet Some easy way which I can use to make all words CAPS.
Thanks.
Â
Mahesh
Excel or Macro Script: Which way is better to use in Excel?
Â
Hi,
Â
Here is my contribution, I think this is the solution you need:
Â
Sub change_caps()
  Dim sh As Worksheet
  Set sh = ActiveSheet
  Dim cll As Range
  For Each sh In ActiveWorkbook.Sheets
    For Each cll In sh.UsedRange
      cll.Value = UCase(cll)
    Next cll
  Next sh
End Sub
Â
Regards,
Â
Prakash
Excel or Macro Script: Which way is better to use in Excel?
Â
Good one Prakash. Here is my solution. This can be used in cases where you want all data in all sheets in caps always.
Â
It changes as we enter.
Â
Public Sub CaseChanger()
Â
Dim Cell As Range
Application.EnableEvents = False
For Each Cell In Selection
If Not Cell.HasFormula Then If Not IsNumeric(Cell) And Len(Cell) > 1 Then Cell = Application.Proper(Cell)
Next Cell
Application.EnableEvents = True
Â
End Sub
Excel or Macro Script: Which way is better to use in Excel?
Here's my solution: Sub Uppercase() ' Loop to cycle through each cell in the specified range. For Each x In Range("A1:A5") ' Change the text in the range to uppercase letters. x.Value = UCase(x.value) Next End Sub Correct me if I'm wrong.
Regards,
Fraklin