LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using EVALUATE to change text to uppercase


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO CHANGE EXISTING XL DATA SHEET TO ALL UPPERCASE TEXT John Excel Discussion (Misc queries) 5 May 30th 07 05:59 AM
Use "PROPER" to change UPPERCASE text to Title Case on worksheet cmurdock Excel Worksheet Functions 1 January 31st 06 11:19 PM
Automatically change text to uppercase Santie Excel Worksheet Functions 1 February 22nd 05 05:20 PM
How to change text in multiple cells from Uppercase to proper cas. Excel help Excel Worksheet Functions 1 November 17th 04 03:45 AM
Change all text in a column to uppercase Ken Loomis Excel Programming 7 October 6th 04 05:14 AM


All times are GMT +1. The time now is 05:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"