Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Starting Line Input from a user given line 1

Status
Not open for further replies.

HarlanJ

Industrial
Jan 24, 2008
7
Hey there,

I've written a macro that reads comma delimited text files into VBA and graphs the data in excel. The graph is set to update every 100 lines of read data before pausing for 5 seconds to let the user view the generated graph. I have some public variables that allow the user to pause the code with a text box or end its execution.

I'm trying to put in a resume button in the worksheet that will allow the user to resume reading the text file at the previous line of termination (if the code was ended by them previously in the text box). I can have the current line number record into a public variable, but I'm not sure how to begin again at that line in the file.

On a side note, I'm using the 'Line Input' statement.
 
Replies continue below

Recommended for you

Start reading file from the beginning and then skip first N_read lines:
Code:
for i = 1 to N_read
    Line Input #1, strDummyTextLine
next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor