View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tony Sinclair Tony Sinclair is offline
external usenet poster
 
Posts: 5
Default OpenText Method Question

I am trying to automate the pasting of data into my worksheet. I am
manually copying a table from a website (highlight and Ctrl-C), and
then doing a Paste Special as text, and then using the Import Text
wizard to specify columns and delimiters.

In bumbling through the VBA docs, I found the Workbooks.OpenText
Method, which seems to duplicate the function of the Import Text
wizard. But there are two problems with it ---

1) It wants a filename, but my data will be in the clipboard
2) It wants to put the parsed data into a new workbook with a single
sheet, while I want my data appended to an existing sheet.

Basically I want to be able to highlight a cell and enter a macro key,
and have the table pasted into my worksheet, with the selected cell as
the upper left corner of the table. I don't think it would be worth
my time to figure out how to use the OpenText method as described in
the docs, if I then have to go back and copy all the individual
workbooks into my sheet.

I am a novice at Excel and VBA, but I'm proficient at C#, so I think I
can probably follow an explanation involving objects and methods. Is
there a workaround for the two problems above? Thank you.