Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a log .txt file

Status
Not open for further replies.

t16turbo

Programmer
Mar 22, 2005
315
GB
I'm interested in creating a log file that will go through a range of data and apend to a text file for any 'errors'

I'm hopeing this is straight forward.

the steps would be:
open/create text file
identify range of data in spreadsheet
for each row, analyse column C
If it is NULL or contains #N/A then add text to file
in the format "Project " & [A<row number>] &" does not have a group code"

then save the text file and close.

can anyone point me in the right direction for some code that would acheive the above?

thanks in advance




 
'Open a file

mFileHandle = FreeFile
strPath=<enter file location>
Open strPath For Append Shared As #mFileHandle
' For Append means that the text will always be added at the end of the existing text

'Add text to the file

Print #mFileHandle, "First Line : Blabla"
Print #mFileHandle, "Second Line : Blabla"

'Close the file
Close #mFileHandle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top