×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Starting Line Input from a user given line

Starting Line Input from a user given line

Starting Line Input from a user given line

(OP)
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

RE: Starting Line Input from a user given line

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

RE: Starting Line Input from a user given line

(OP)
That works well.

Thanks Yakov!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close