Using Input statement to read from text/csv file

KGee

Well-known Member
Joined
Nov 26, 2008
Messages
537
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I'm using the input statement to read data from a CSV file. I need to retrieve the strings from the 7th and 14th fields in the file and assign them to variables. Is there any way to specify only the 7th and 14th fields so I don't have to bother listing the other 12 variables I don't need?
Code:
Input #1, var1, var2, var3...var14
 
Ah I see. That's what happens when you take everything literally. However I do think it would be easier to learn VBA if the commands were simplified to that level. :biggrin:

Thanks again.
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I can't make up my own commands?:rolleyes::ROFLMAO:
I always thought a ComeFrom command would be useful to drag one's code back on track when it gets a bit lost from doing too many GoTos.
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,914
Members
449,132
Latest member
Rosie14

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