SearchForHardwiredConstant |
This page in 2003 Top Previous Next |
|
Searches a specified area of a worksheet for cells that have contain a hardwired constant, selecting any that are found in a multi-area range. An example of a hardwired constant is =A5*365. The 365 is an assumption, presumably the number of days in year. The danger with embedding such assumptions in a formula is that they might be overlooked when performing an exhaustive check of the inputs to a spreadsheet, since they will not appear in a listing of constants produced by OAK or any similar package, nor be identified by Excel's Home | Find & Select | Go To Special | Constants command. Applies to SYNTAX result1 = expression1.SearchForHardwiredConstant Set result2 = expression2.SearchForHardwiredConstant(Range1) expression1 Required. An expression that returns an IOAKAddIn object. expression2 Required. An expression that returns an IOAKAPI object. result1 An OAKResult enumeration indicating the success or otherwise of the action. result2 A Range consisting of all the cells found within Range1 that contain hardwired constants, or Nothing if no such cells are found. Range1 Required Range. The range in which to search for cells that contain hardwired constants. Remarks When applied to an IOAKAddIn object, the SearchForHardwiredConstant method performs the same action as the OAK Development | Search | Hardwired constants command. It searches for cells containing a hardwired constant within the current selection. When applied to an IOAKAPI object, the SearchForHardwiredConstant method applies searches for cells containing a hardwired constant within the range indicated by the parameter submitted to the method. Wrinkles When applied to an IOAKAddIn object, the SearchForHardwiredConstant method follows the One-cell rule. When applied to an IOAKAPI object, it does not: if supplied a Range parameter describing a single cell, it will look in that cell only. When applied to an IOAKAddIn object, the method will display a dialog box if no cells containing a hardwired constant are detected, just as the equivalent OAK user-interface command does. |