XL2002: Macro Designed to Paste Text into Worksheet Cell Does Not Work as Expected (280604)



The information in this article applies to:

  • Microsoft Excel 2002

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 "More Information" section of this article for further details.

WORKAROUND

To work around this issue, record a macro that uses the Paste command on the Edit menu to paste the data, 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.
  2. Name the macro, and then click OK.
  3. Select the cell that you want to paste the data into, and then click Paste on the Edit menu.
  4. On the Data menu, click Text to Columns.
  5. Follow the instructions in the Convert Text to Columns Wizard, and then click Finish in step 3 of 3.
  6. On the Record New Macro toolbar, click Stop.

    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 2002 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.

Modification Type:MajorLast Reviewed:10/4/2001
Keywords:kbbug KB280604