709-218-7927

The Landfall Garden House

60 Canon Bayley Road

CANADA A0C 1B0

CPRGreaves@gmail.com

Home

Christopher Greaves

Error! Not a valid filename.

Explore

Obtain lists of worksheets, styles and so on; a read-only pass to understand the debris.

Seq

Macro

Description

1

ListWorksheets

Produce a count and list of all worksheets in the workbook.

2

HomeEachSheet

Set the cell pointer to cell A1 in each worksheet.

3

ListStyles

Obtain a pop-up list of all styles in the workbook.

4

ListStylesBuiltin

Obtain a pop-up list of Excel’s built-in styles in the workbook.

5

ListStylesUser

Obtain a pop-up list of all user-defined styles in the workbook.

6

DumpStyles

Drop a set of random data formatted by styles into the active cell and the cells below it.

7

DumpStylesBuiltin

Drop a set of random data formatted by of Excel’s built-in styles into the active cell and the cells below it.

8

DumpStylesUser

Drop a set of random data formatted by user-defined styles into the active cell and the cells below it.

9

FindErrors

Identify the first error in a workbook.

10

ListAllRangeNames

Produce a pop-up list of all named ranges in the workbook.

11

ListUnusedRangeNamesInWorkSHEET

Produce both a pop-up list of unused range names AND place a copy of the list in the clipboard.

12

ListUnusedRangeNamesInWorkBOOK

13

WhatIsMyRangeName

Delivers a pop-up list of all range names that refer to the first cell in the selection.

14

WorkbookFindAll

Worksheets

Make a preliminary scan of the workbook.

ListWorksheets

What worksheets are visible?

Use the macro ListWorksheets to produce a count and list of all worksheets in the workbook.

Christopher Greaves StainUserGuide_001.JPG

In this case we have no hidden sheets.

HomeEachSheet

Use the macro HomeEachSheet to set the cell pointer to cell A1 in each worksheet.

ListStyles

Use the macro ListStyles to obtain a pop-up list of all styles defined in the workbook.

Christopher Greaves StainUserGuide_002.JPG

In most cases the list will be a straightforward as the example above, since few users have caught on to the glory of Styled formatting.

Christopher Greaves StainUserGuide_003.JPG

But every now and then you will stumble across an astute user.

Christopher Greaves StainUserGuide_004.JPG

Use the macros ListStylesBuiltin and ListStylesUser to produce sub-sets of the main list.

DumpStyles

Use the macro DumpStyles to d

CAUTION: Although this macro is listed as “exploratory” it will make a change to the current workbook.

Christopher Greaves StainUserGuide_005.JPG

I generally open a now worksheet immediately before running the macro DumpStyles.

Tap the F9 function key to recalculate cells as a cheap way of checking that the styled formatting suffices for most purposes.

Use the macros DumpStylesBuiltin and DumpStylesUser to produce sub-sets of the main list.

Errors

FindErrors

Your proposal stipulates that workbooks will be error-free, or that errors will be fixed at hourly rates, right?

Use the macro FindErrors to identify the first error in a workbook.

Christopher Greaves StainUserGuide_006.JPG

If no errors are found, the workbook appears undisturbed.

When an error is found, the macro jumps to the offending cell and terminates.

Range Names

ListAllRangeNames

Use the macro ListAllRangeNames to produce a pop-up list of all named ranges in the workbook.

Christopher Greaves StainUserGuide_007.JPG

ListUnusedRangeNamesInWorksheet

Use the macro ListUnusedRangeNamesInWorksheet to produce both a pop-up list of unused range names AND place a copy of the list in the clipboard.

Christopher Greaves StainUserGuide_008.JPG

ListUnusedRangeNamesInWorkSHEET

Use the macro ListUnusedRangeNamesInWorkSHEET to obtain a pop-up list of all range names in the workbook which are not referenced in the currently active worksheet.

Christopher Greaves StainUserGuide_010.JPG

ListUnusedRangeNamesInWorkBOOK

Use the macro ListUnusedRangeNamesInWorkBOOK to obtain a pop-up list of all range names in the workbook which are not referenced in the currently active worksheet.

DisplayIllegalReferences

Use the macro DisplayIllegalReferences to obtain a pop-up list of all range names in the workbook which are based on non-existent spreadsheet cells. Such range names will appear with #REF in the Insert, Names, define dialog.

See also the companion macro DeleteIllegalReferences.

WhatIsMyRangeName

Use the macro WhatIsMyRangeName to determine what ranges are defined on the first cell of a selection.

Christopher Greaves StainUserGuide_009.JPG

In the example above, we have selected cell B1 of the sheet Tables in the workbook Example012.

The macro WhatIsMyRangeName tells us that two ranges are define don this cell.

Multiple range names for a range are not evil, but they do suggest an element of confusion.

In particular when we are reading excel formulas, we usually expect that each range name refers to a unique cell, and that “Arena” and “Gymnasium” might be referring to different places – both in the workbook and in the real world..

WorkbookFindAll

Use the macro WorkbookFindAll to locate all occurrences of a string, and select the last found occurrence.

This macro can be used effectively to scour a workbook for occurrences of a range name.

709-218-7927 CPRGreaves@gmail.com

Bonavista, Thursday, December 17, 2020 7:22 AM

Copyright © 1996-2020 Chris Greaves. All Rights Reserved.