XL5: Drag to Replace in Recorded Macro Returns Invalid CodeLast reviewed: September 2, 1997Article ID: Q110709 |
The information in this article applies to:- Microsoft Excel for Windows, version 5.0
SUMMARYIn Microsoft Excel version 5.0 for Windows, when you are recording a Visual Basic subroutine and you drag a cell or range of cells to another cell or range of cells to replace the original information, the recorded subroutine may contain syntax errors that prevent it from functioning correctly.
WORKAROUNDTo work around this problem, you may need to modify the recorded code. The modified code should resemble the following:
Sub Macro1() Range("A1").Select Selection.Cut (Range("B1")) Range("B1").Select End SubThe third line, which originally contained invalid code, has been replaced by a line of code that performs the correct action.
MORE INFORMATION
Steps to Reproduce Problem
Sub Macro1() Range("A1").Select ExecuteExcel4Macro "CUT(Range("A1"),Range("B1"))" Range("B1").Select End SubThe third line (which starts with the ExecuteExcel4Macro method) will appear in red, indicating that the line contains a syntax error.
|
Additional query words: 5.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |