I want to append only the value rows to another workbook & Worksheet.
My major problem is I have been trying to write the macro to open a new workbook and after devera;l hours of searching the internet, I can't get a new workbook to open.
Here's the most recent macro I've tried . When I go to TOOLS and RUN the macro I get no errors but I also don't get a new file????????
Code: Select all
Sub dtatfile()
Dim FileNo As Integer
Dim CurrentLine As String
Dim Filename As String
Filename = "c:\data.txt" ' Define file name
FileNo = FreeFile ' Establish free file handle
Open Filename For Output As #FileNo ' Open file (writing mode)
Print #FileNo, "This is a line of text" ' Save line
Print #FileNo, "This is another line of text" ' Save line
Close #FileNo ' Close file
End Sub
Any suggestions would be appreciated