View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default Paste into opened notepad file

I don't know how to paste the clipboard contents into another spawned process
as you want. There may be a way to do it, but I would suggest reading about
opening/closing/reading/writing to text files in VB help.

You don't say where you want to paste the cell contents in the file. Below
are two examples. The first one appends the cells to the end of the file.
The second one appends each cell to the end of each line of the text file,
assuming there is one line for each cell.

I did not test these examples, they are simply to give you an idea how to
get started.

' Method 1 - append to end of file

Dim Cell As Range

Open "C:\project\fyp1.xml" For Append As #1

For Each Cell In Sheets("Sheet3").Range("A1:A42")
Print #1, Cell.Text
Next Cell

Close #1

' Method 2 - append to end of each line of file

Dim Rec As String
Dim nRec As Long

Open "C:\project\fyp1.xml" For Input As #1
Open "C:\project\fyp1_NEW.xml" For Output As #2

Do While Not EOF(1)
Line Input #1, Rec
nRec = nRec + 1
Print #1, Rec & Sheets("Sheet3").Cells(nRec, 1).Text
Loop

Close #1
Close #2


"oOpsy" wrote:


any kind soul able to help?


--
oOpsy
------------------------------------------------------------------------
oOpsy's Profile: http://www.excelforum.com/member.php...o&userid=29132
View this thread: http://www.excelforum.com/showthread...hreadid=489798