Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excel change case add in
This free to use excel add in changes text to lower, upper and proper
case. Try it out http://exceltemplates.blogspot.com/2...ange-case.html |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excel change case add in
Don't want to be *too* critical, but since you're offering this in an
open forum, people who might download your add-in should be aware of a few flaws: 1) There is a BAD bug in your code. If you select two or more cells with formulae in them, those formulae are converted to string literals. E.g: Before After A1: ="Profit: " & J1 PROFIT: 100 A2: ="hello" HELLO J1: 100 100 2) The add-in changes the Selection - in general that's bad form, especially when the add-in's behavior depends on the Selection object. Much better to use range objects directly. This is especially true if the user has a _SelectionChange event macro, which might have unpredictable effects on your add-in's behavior. 3) Resetting the user's calculation mode to Automatic is also generally bad form. 4) Using SpecialCells is problematic and can lead to inconsistent behavior without careful coding. If a single cell is selected, Selection.SpecialCells will select from the entire worksheet, while if two or more cells are selected, SpecialCells only looks at the selected cells. 5) Protecting your code for such a simple function is overkill and should lead users with any degree of caution to avoid your add-in. All of these should be easy to correct. In article om, "Mr.Cricket" wrote: http://exceltemplates.blogspot.com/2...ange-case.html |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excel change case add in
4) Using SpecialCells is problematic and can lead to inconsistent behavior without careful coding. If a single cell is selected, Selection.SpecialCells will select from the entire worksheet, That has bitten me in the ass a few times. I think the design decision to default to the whole sheet is one of the dumber decisions MS has made for Excel in quite a while. -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "JE McGimpsey" wrote in message ... Don't want to be *too* critical, but since you're offering this in an open forum, people who might download your add-in should be aware of a few flaws: 1) There is a BAD bug in your code. If you select two or more cells with formulae in them, those formulae are converted to string literals. E.g: Before After A1: ="Profit: " & J1 PROFIT: 100 A2: ="hello" HELLO J1: 100 100 2) The add-in changes the Selection - in general that's bad form, especially when the add-in's behavior depends on the Selection object. Much better to use range objects directly. This is especially true if the user has a _SelectionChange event macro, which might have unpredictable effects on your add-in's behavior. 3) Resetting the user's calculation mode to Automatic is also generally bad form. 4) Using SpecialCells is problematic and can lead to inconsistent behavior without careful coding. If a single cell is selected, Selection.SpecialCells will select from the entire worksheet, while if two or more cells are selected, SpecialCells only looks at the selected cells. 5) Protecting your code for such a simple function is overkill and should lead users with any degree of caution to avoid your add-in. All of these should be easy to correct. In article om, "Mr.Cricket" wrote: http://exceltemplates.blogspot.com/2...ange-case.html |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excel change case add in
In article ,
"Chip Pearson" wrote: That has bitten me in the ass a few times. I think the design decision to default to the whole sheet is one of the dumber decisions MS has made for Excel in quite a while. Agreed - in my apps the only way I use SpecialCells on a Selection (which is admittedly very rarely) is to wrap it with the Intersect method - usually in a function, so I don't forget, e.g.: Public Function SelectionSpecialCells( _ ByVal nType As Long, _ Optional ByVal vValue As Variant = Empty) As Range Dim rTest As Range If TypeOf Selection Is Excel.Range Then With Selection If IsEmpty(vValue) Then Set rTest = Intersect(.Cells, .SpecialCells(nType)) Else Set rTest = Intersect(.Cells, .SpecialCells(nType, vValue)) End If End With End If Set SelectionSpecialCells = rTest End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I change case to sentence case in groups in excel? | Excel Discussion (Misc queries) | |||
How to change mixed case to upper case in Excel for all cells | Excel Discussion (Misc queries) | |||
Excel: How do I change all upper case ss to proper case? | Excel Worksheet Functions | |||
Change the text from lower case to upper case in an Excel work boo | Excel Discussion (Misc queries) | |||
How do I change a column in Excel from upper case to lower case? | Excel Worksheet Functions |