Microsoft KB Archive/103287: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
Line 22: Line 22:
== SUMMARY ==
== SUMMARY ==


You can modify the example macro on page 273 of the &quot;User's Guide 2,&quot; version 4.0; on page 633 of the &quot;User's Guide,&quot; version 3.0 for Windows; or on page 629 of the &quot;User's Guide,&quot; version 3.0 for the Macintosh, so that you can automatically add items to the linked list if they do not already exist.<br />
You can modify the example macro on page 273 of the "User's Guide 2," version 4.0; on page 633 of the "User's Guide," version 3.0 for Windows; or on page 629 of the "User's Guide," version 3.0 for the Macintosh, so that you can automatically add items to the linked list if they do not already exist.<br />
<br />
<br />
In order to successfully modify this macro, you should be familiar with the following information:<br />
In order to successfully modify this macro, you should be familiar with the following information:<br />
Line 32: Line 32:
* The macro functions DEFINE.NAME(), IF(), MATCH(), OFFSET(), and FORMULA().
* The macro functions DEFINE.NAME(), IF(), MATCH(), OFFSET(), and FORMULA().


The custom dialog box allows you to select an instrument from a list and displays it in a text box. The items appearing in the list box come from an area named &quot;Instruments.&quot; If you type the name of an instrument that is not on the list, the following macro adds it to the end of the existing list and redefines the defined name &quot;Instruments&quot; to include the new item.<br />
The custom dialog box allows you to select an instrument from a list and displays it in a text box. The items appearing in the list box come from an area named "Instruments." If you type the name of an instrument that is not on the list, the following macro adds it to the end of the existing list and redefines the defined name "Instruments" to include the new item.<br />
<br />
<br />
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:<br />
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:<br />
Line 43: Line 43:


<ol>
<ol>
<li>Select the range P6:P21. On the Formula menu, click Define Name, and name the region &quot;Instruments&quot;.</li>
<li>Select the range P6:P21. On the Formula menu, click Define Name, and name the region "Instruments".</li>
<li>Replace the contents of cell N16 (R6C16:R21C16) with the Name '''&quot;Instruments&quot;''' (without quotation marks).</li>
<li>Replace the contents of cell N16 (R6C16:R21C16) with the Name '''"Instruments"''' (without quotation marks).</li>
<li>Move the macro code in cells N1:N3 to cells H1:H3.</li>
<li>Move the macro code in cells N1:N3 to cells H1:H3.</li>
<li><p>Delete the &quot;=RETURN()&quot; statement in cell H3. Starting at cell H3, add the following macro commands:<br />
<li><p>Delete the "=RETURN()" statement in cell H3. Starting at cell H3, add the following macro commands:<br />
<br />
<br />
</p>
</p>
Line 53: Line 53:
       H5: =  IF(ISNA(H4))
       H5: =  IF(ISNA(H4))
       H6: =    FORMULA(O15,OFFSET(P6,ROWS(Instruments),0))
       H6: =    FORMULA(O15,OFFSET(P6,ROWS(Instruments),0))
       H7: =    SET.NAME(&quot;Instruments&quot;,OFFSET(P6,0,0,ROWS(Instruments)+1,1))
       H7: =    SET.NAME("Instruments",OFFSET(P6,0,0,ROWS(Instruments)+1,1))
       H8: =  END.IF()
       H8: =  END.IF()
       H9: =END.IF()
       H9: =END.IF()
Line 60: Line 60:
=== Explanation of Above Macro ===
=== Explanation of Above Macro ===


<pre class="FIXEDTEXT">  H3:  Check to see if the &quot;Cancel&quot; button was not chosen.
<pre class="FIXEDTEXT">  H3:  Check to see if the "Cancel" button was not chosen.
   H4:  The MATCH statement checks to see if the name is on the list.
   H4:  The MATCH statement checks to see if the name is on the list.
   H5:  Checks to see if MATCH returns #N/A, indicating that the name is
   H5:  Checks to see if MATCH returns #N/A, indicating that the name is
         not on the list.
         not on the list.
   H6:  Places the new instrument on the list as the last item.
   H6:  Places the new instrument on the list as the last item.
   H7:  Redfines the &quot;Instruments&quot; name to include the new item.
   H7:  Redfines the "Instruments" name to include the new item.
   H8:  Signals the ending of the first if statement.
   H8:  Signals the ending of the first if statement.
   H9:  Signal the ending of the second if statement.
   H9:  Signal the ending of the second if statement.
Line 74: Line 74:
== REFERENCES ==
== REFERENCES ==


&quot;User's Guide 2&quot;, version 4.0, page 277<br />
"User's Guide 2", version 4.0, page 277<br />
&quot;User's Guide&quot;, version 3.0, page 637
"User's Guide", version 3.0, page 637


Additional query words: 4.00a XL3 XL4
Additional query words: 4.00a XL3 XL4

Revision as of 09:26, 20 July 2020

XL3/XL4: Dynamic Linked List Dialog Boxes



The information in this article applies to:


  • Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a
  • Microsoft Excel for OS/2, version 3.0
  • Microsoft Excel for the Macintosh, versions 3.0, 4.0





SUMMARY

You can modify the example macro on page 273 of the "User's Guide 2," version 4.0; on page 633 of the "User's Guide," version 3.0 for Windows; or on page 629 of the "User's Guide," version 3.0 for the Macintosh, so that you can automatically add items to the linked list if they do not already exist.

In order to successfully modify this macro, you should be familiar with the following information:


  • How to set up, write, define and execute a command macro.
  • How to create and use custom dialog boxes.
  • The macro functions DEFINE.NAME(), IF(), MATCH(), OFFSET(), and FORMULA().

The custom dialog box allows you to select an instrument from a list and displays it in a text box. The items appearing in the list box come from an area named "Instruments." If you type the name of an instrument that is not on the list, the following macro adds it to the end of the existing list and redefines the defined name "Instruments" to include the new item.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

To modify the example macro, follow these steps:


  1. Select the range P6:P21. On the Formula menu, click Define Name, and name the region "Instruments".
  2. Replace the contents of cell N16 (R6C16:R21C16) with the Name "Instruments" (without quotation marks).
  3. Move the macro code in cells N1:N3 to cells H1:H3.
  4. Delete the "=RETURN()" statement in cell H3. Starting at cell H3, add the following macro commands:

          H3: =IF(H2<>FALSE)
          H4: =  MATCH(O15,Instruments,0)
          H5: =  IF(ISNA(H4))
          H6: =    FORMULA(O15,OFFSET(P6,ROWS(Instruments),0))
          H7: =    SET.NAME("Instruments",OFFSET(P6,0,0,ROWS(Instruments)+1,1))
          H8: =  END.IF()
          H9: =END.IF()
         H10: =RETURN() 

Explanation of Above Macro

   H3:  Check to see if the "Cancel" button was not chosen.
   H4:  The MATCH statement checks to see if the name is on the list.
   H5:  Checks to see if MATCH returns #N/A, indicating that the name is
        not on the list.
   H6:  Places the new instrument on the list as the last item.
   H7:  Redfines the "Instruments" name to include the new item.
   H8:  Signals the ending of the first if statement.
   H9:  Signal the ending of the second if statement.
  H10: Ends the macro. 



REFERENCES

"User's Guide 2", version 4.0, page 277
"User's Guide", version 3.0, page 637

Additional query words: 4.00a XL3 XL4

Keywords : kbcode kbprg
Version : WINDOWS:3.0,4.0,4.0a; OS/2:3.0: MACINTOSH:3.0,4.0
Platform : MACINTOSH OS/2 WINDOWS
Issue type :
Technology :


Last Reviewed: November 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.