Write to text file

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

Guest

Hallo

I am tring to write to a txt file. I have following code, it not work properly

Sub OpenFile(

Dim Data As Strin

Data = Range("A1"
Open "c:\Files.txt" For Output As #
Write #1, Dat
Close #

End Su

I want to open file, right what in cell A1.
Problem I have 1. It rights with "" so instead of Code1 I get "Code1". 2 When I run the macro for next code How do I position get to next line s

Code
Code

Please help Thanck you
 
Sub OpenFile()

Dim Data As String

Data = Range("A1")
Open "c:\Files.txt" For Append As #1
Print #1, Data
Close #1

End Sub

--
Regards,
Tom Ogilvy


Grujen said:
Hallo,

I am tring to write to a txt file. I have following code, it not work properly.

Sub OpenFile()

Dim Data As String

Data = Range("A1")
Open "c:\Files.txt" For Output As #1
Write #1, Data
Close #1

End Sub

I want to open file, right what in cell A1.
Problem I have 1. It rights with "" so instead of Code1 I get "Code1". 2
When I run the macro for next code How do I position get to next line so
 
Back
Top