Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If Range("a1:d10") has lower case text, CodeA successfully converts to UPPER CASE in Range("e1:h10") using WorkSheetFunction FormulArray. I would expect EVALUATE to achieve the same result using CodeB. Can someone tweak it to work? CODE A. Sub UpperCaseArrayFmla() Lcol = Cells.SpecialCells(xlCellTypeLastCell).Column rws = ActiveSheet.UsedRange.Rows.Count cols = ActiveSheet.UsedRange.Columns.Count Set rng = Cells(1, Lcol + 1).Resize(rws, cols) rng.FormulaArray = "=UPPER(" & "a1:d10" & ")" End Sub CODE B Sub EvaluateUpperCaseFmla() Dim a Lcol = Cells.SpecialCells(xlCellTypeLastCell).Column rws = ActiveSheet.UsedRange.Rows.Count cols = ActiveSheet.UsedRange.Columns.Count Set rng = Cells(1, Lcol + 1).Resize(rws, cols) 'ReDim a(rws, cols) a = Evaluate("(UPPER" & "a1:d10" & ")") rng.Value = a End Sub PS: The alternate and perhaps superior way is looping through the range using vba UCASE -- Myles ------------------------------------------------------------------------ Myles's Profile: http://www.excelforum.com/member.php...o&userid=28746 View this thread: http://www.excelforum.com/showthread...hreadid=489318 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW TO CHANGE EXISTING XL DATA SHEET TO ALL UPPERCASE TEXT | Excel Discussion (Misc queries) | |||
Use "PROPER" to change UPPERCASE text to Title Case on worksheet | Excel Worksheet Functions | |||
Automatically change text to uppercase | Excel Worksheet Functions | |||
How to change text in multiple cells from Uppercase to proper cas. | Excel Worksheet Functions | |||
Change all text in a column to uppercase | Excel Programming |