Do Until EOF Does Not Loop Properly | MrExcel Message Board
Có thể bạn quan tâm
- Forums New posts Search forums Board Rules
- What's new Featured content New posts New Excel articles Latest activity
- New posts
- Excel Articles Latest reviews Search Excel articles
- MrExcel Homepage MrExcel Bookstore MrExcel Seminars Excel Consulting Services
Search
Everywhere Threads This forum This thread Search titles only Note Search Advanced search…- New posts
- Search forums
- Board Rules
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
- If you would like to post, please check out the MrExcel Message Board FAQ and register here. If you forgot your password, you can reset your password.
- Forums
- Question Forums
- Excel Questions
- Thread starter Thread starter mtenorio
- Start date Start date Jan 12, 2015
- Tags Tags eof text file vba
mtenorio
New Member
Joined Sep 5, 2014 Messages 18 Hi guys! I am working on an application where a text file is opened then some lines are deleted based on a criteria. I am using the following code to read the text per line: Code: If FileName(root_loc, period, wsc_code) = "" Then MsgBox "There is no e-file found for the period M" & period & "." Else 'Opens the e-file Open FileName(root_loc, period, wsc_code) For Input As #1 row_number = 0 Do Until EOF(1) 'reads the text line per line until the end of file Line Input #1, LineFromFile row_number = row_number + 1 Loop Close #1 Debug.Print row_number End If Supposedly I would get 58 for the Debug.Print row_number since 58 is the number of lines on the text file, but instead I get 1. But when I try Debug.Print LineFromFile, the whole file gets printed.. Do you guys have an idea why I am getting 1 only for the number of lines? Thanks a lot!Excel Facts
Is there a shortcut key for strikethrough? Click here to reveal answer Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5. Sort by date Sort by votes DDomenic
MrExcel MVP
Joined Mar 10, 2004 Messages 21,801 Office Version- 365
- Windows
mtenorio
New Member
Joined Sep 5, 2014 Messages 18 Hello Domenic! I've tried this and it worked perfectly fine! thanks a lot!!! Upvote 0 DDomenic
MrExcel MVP
Joined Mar 10, 2004 Messages 21,801 Office Version- 365
- Windows
Ileska
New Member
Joined Sep 15, 2022 Messages 1 Office Version- 365
- Windows
Similar threads
- Question Question
- TryingToLearn
- Oct 5, 2024
- Excel Questions
- Question Question
- rdtoner
- Dec 4, 2024
- Excel Questions
- Solved
- BakerSteve
- May 6, 2024
- Excel Questions
- Question Question
- ozbeachbum
- Oct 30, 2024
- Excel Questions
- Question Question
- CRG
- Mar 15, 2024
- Excel Questions
Forum statistics
Threads 1,225,145 Messages 6,183,146 Members 453,148 Latest member yevhenShare this page
Facebook X (Twitter) LinkedIn Reddit Tumblr WhatsApp Email Share Link- Forums
- Question Forums
- Excel Questions
We've detected that you are using an adblocker.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.Allow Ads at MrExcelWhich adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock1)Click on the icon in the browser’s toolbar.2)Click on the icon in the browser’s toolbar.2)Click on the "Pause on this site" option. Go backDisable AdBlock Plus
Follow these easy steps to disable AdBlock Plus1)Click on the icon in the browser’s toolbar.2)Click on the toggle to disable it for "mrexcel.com". Go backDisable uBlock Origin
Follow these easy steps to disable uBlock Origin1)Click on the icon in the browser’s toolbar.2)Click on the "Power" button.3)Click on the "Refresh" button. Go backDisable uBlock
Follow these easy steps to disable uBlock1)Click on the icon in the browser’s toolbar.2)Click on the "Power" button.3)Click on the "Refresh" button. Go back Continue without adsI've disabled my adblock Back TopTừ khóa » Visual Basic Do Until Eof
-
EOF Function (Visual Basic For Applications) | Microsoft Docs
-
EOF (hàm EOF - Microsoft Support
-
VBA EOF Function - Automate Excel
-
EOF Function - VB & VBA In A Nutshell: The Language [Book]
-
EOF Function - VB.NET Language In A Nutshell, Second Edition [Book]
-
Do Until EOF Loop With Records In VB 2010 - Stack Overflow
-
EOF Function - Visual Basic VBA
-
Do Loop - Code VBA
-
Use Do While To Loop Through Until EOF : Recordset Seek
-
VBA Function EOF
-
Cú Pháp Và Cách Sử Dụng Hàm Input VBA Excel Qua Các Ví Dụ Cụ Thể
-
Read Data From A Text File Using Excel VBA (In Easy Steps)
-
While Not EOF(fn) ... Wend - Visual Basic 4 / 5 / 6 - Bytes