Microsoft KB Archive/280604

= Macro that is designed to paste text into worksheet cell does not work as expected in Excel =

Article ID: 280604

Article Last Modified on 2/8/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition

-



This article was previously published under Q280604



SYMPTOMS
In Microsoft Excel, when you record a macro designed to automatically paste text into a worksheet cell, the macro may not work as expected.



CAUSE
This behavior can occur if you include the Use Text Import Wizard command (under the Paste Options button) in the macro. See the &quot;More Information&quot; section of this article for further details.



WORKAROUND
To work around this issue, record a macro that uses the Paste command, and which then uses the Text to Columns command on the Data menu to parse the data.

To do this, follow these steps.

NOTE: You must already have data copied into the Clipboard memory.
 * 1) On the Tools menu in Excel, point to Macro, and then click Record New Macro.

Note If you use Microsoft Office Excel 2007, click Record Macro in the Code group on the Developer tab.
 * 1) Name the macro, and then click OK.
 * 2) Select the cell that you want to paste the data into, and then click Paste on the Edit menu.

Note If you use Excel 2007, click Paste in the Clipboard group on the Home tab.
 * 1) On the Data menu, click Text to Columns.
 * 2) Follow the instructions in the Convert Text to Columns Wizard, and then click Finish in step 3 of 3.
 * 3) On the Record New Macro toolbar, click Stop.

Note If you use Excel 2007, click Stop Recording in the Code group on the Developer tab.

The macro now works as expected.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The Use the Text Import Wizard option in the Paste Options dialog box becomes available whenever Excel interprets the text that you are pasting as a type that would need to be parsed for it to be pasted correctly. Examples of this include plain text, lists that are separated by commas or semicolons, and text that resembles HTML code.

Additional query words: OFF2002 XL2002 XL2003 XL2007 kbnoOfficeAlertID

Keywords: kbbug kbpending KB280604

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.