Copying Word text to Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a program that copies text from Word into Excel.

I've tried copying the text into a string and writing that into Excel;
I've tried copying the Word text into the clipboard and pasting into Excel;

Either way, the text is a mess when it comes in and I can't seem to get it
very clean. Does anyone have a function or method for doing this cleanly? Is
it even possible?

The text is not highly formatted (only some bold). Thanks much in advance
for your suggestions.
 
Try this:

dirtyStr = 'Assing this to the text from the WinWord
clnStr = Application.WorksheetFunction.Clean(dirtyStr)
Worksheets("Sheet1").Range("A1").Value = clnStr

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top