I am trying to achieve a simple objective,insert row count and column count summary of an excel file to an existing notepad.
I have multiple files in a folder and would like to run this operation for each file and send the details to a notepad.
Issue: Every time i run the code it deletes existing content and inserts new data into the notepad. I would like to retain existing data and start appending from a new line
code:
Sub Sndtotxt()
Dim FF
Dim rCnt AS INTEGER
Dim cCnt AS INTEGER
rCnt = ActiveSheet.UsedRange.Rows.Count
cCnt = ActiveSheet.UsedRange.Columns.Count
FF = FreeFile()
OPEN "C:\Temp files\summaryreport.txt" FOR Output AS #FF
Print #FF, rCnt
Print #FF, cCnt
CLOSE #FF
END Sub