View Full Version : [SOLVED:] How to write last row update record in excel into txt file ?
Dear all,
How to write last row update record in excel into txt file,
the txt file is used for accumlating the data records.
Thank you very much!
17292
i intend to know how to update just one row of data in excel to txt file?
I mean the steps
1.copy one row of data in excel
2.open the txt file which contains some previously saved string
3.open a new line in the txt file
4.then paste it in the txt file
5.save the txt file
6.close the txt file
open the old txt file and open a new line and copy the
Option Explicit
Sub test()
Dim v, s As String
Dim myPath As String
myPath = "C:\***\***\test.txt"
v = Range("a1").End(xlDown).Resize(, 3).Value
s = Join(WorksheetFunction.Transpose(WorksheetFunction.Transpose(v)), ",")
Open myPath For Append As #1
Print #1, s
Close #1
End Sub
What is the difference between write and print ?
try this.
Open myPath For Append As #1
Print #1, s
Write #1, s
Close #1
YasserKhalil
10-07-2016, 09:24 PM
I think Write treats output as string so in output you will notice quotations " " around the results , but Print doesn't do that
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.