Row Count of Imported Notepad File

music_al

Board Regular
Joined
Nov 26, 2008
Messages
133
Hi

I have a sub routine that prompts the user to open a file and the user then selects a NOTEPAD file. The sub routine then cleanses the file and formats certain cells.

I then want to return the number of rows in the file but the code I'm using only returns 1 when there are 230 rows in the file...

Batch_Row_Count = ActiveSheet.UsedRange.Rows.Count


Is this because it is not an Excel file even though I have opened it in Excel ?

Thank you in advance.

Al
 
If you were to put a button in another spreadsheet and call this code from that button, you might see what's happening.
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
It works fine for me opening a text file. It becomes the activeworkbook regardless how the code is run. I cant replicate what you say is happening.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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 MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)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 back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top