I have words in cell range (i.e. A1:A1000) and I want them to became upper letters.
Excel forum to EXCEL FORUM
Please macro wich I can assign to some button![]()
I have words in cell range (i.e. A1:A1000) and I want them to became upper letters.
Excel forum to EXCEL FORUM
Please macro wich I can assign to some button![]()
Last edited by zbor; 12-07-2009 at 04:44 AM.
Never use Merged Cells in Excel
I would use Evaluate
![]()
Public Sub ConvertUpper() With Range("A1:A1000") .Value = Evaluate("IF(ISTEXT(" & .Address & "),UPPER(" & .Address & "),REPT(" & .Address & ",1))") End With End Sub
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
I should have added that if you wanted the range to be based on active selection then
(evaluate essentially allows up to update en masse without iteration - here the iteration is only per range area should you select multi non-contiguous ranges, all cells within that area are updated simultaneously)![]()
Public Sub ConvertUpper() Dim rngArea As Range For Each rngArea In Selection.Areas With rngArea .Value = Evaluate("IF(ISTEXT(" & .Address & "),UPPER(" & .Address & "),REPT(" & .Address & ",1))") End With Next rngArea End Sub
Working! Thx!
Y, works too
(and when I said few months ago that I will start learning macro soon... I lie)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks