Jan 2, 2002 #1 ajpalm Technical User Dec 12, 2001 1 AU I'm using VBa in excel, and wondering if there is a way to read a txt file values in. eg I wish to read the 2nd line of a file, and store its value as a varabile within the vba project? Any ideas?
I'm using VBa in excel, and wondering if there is a way to read a txt file values in. eg I wish to read the 2nd line of a file, and store its value as a varabile within the vba project? Any ideas?
Jan 2, 2002 #2 JustinEzequiel Programmer Jul 30, 2001 1,192 PH dim sFile as string dim sLine as string dim sSecondLineFromFile as string dim nFile as integer nFile=freefile open sFile for input as nFile line input #nFile, sLine ' reads first line line input #nFile, sLine ' reads second line close nFile sSecondLineFromFile=sLine Upvote 0 Downvote
dim sFile as string dim sLine as string dim sSecondLineFromFile as string dim nFile as integer nFile=freefile open sFile for input as nFile line input #nFile, sLine ' reads first line line input #nFile, sLine ' reads second line close nFile sSecondLineFromFile=sLine