The information in this article applies to:
SYMPTOMSWhen you record a Microsoft Visual Basic for Applications macro that adds a defined name to a Microsoft Excel workbook, the following line of code may be recorded twice in the module:
Where "DefinedName" refers to the name you typed in, "SheetName" is the
name of your worksheet, and "Range" is the range of cells that
"DefinedName" refers to.
CAUSEThis line of code is recorded twice because it is defined once when you click Add in the Define Name dialog box, and again when you click OK. Clicking both buttons accomplishes the same thing; they both assign the defined name. RESOLUTION
If you want a recorded macro to record only one line of code for adding a
single defined name to your workbook, only click OK in the Define Name
dialog box when recording the macro. It is not necessary to click Add.
REFERENCES
For more information about the Add method in Microsoft Excel 97, from the
Visual Basic Editor, click the Office Assistant, type Add, click Search,
and then click to view "Add Method (Workbooks Collection)."
Q176476 OFF: Office Assistant Not Answering Visual Basic Questions For more information about the Add Method of the Names Collection in Microsoft Excel 7.0, click the Office Assistant, type define name, click Search, and then click to view "Add Method (Names Collection)". Additional query words: XL97 XL98 XL7 XL5
Keywords : kbdta PgmOthr KbVBA |
Last Reviewed: October 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |