Reputation: 1
I am trying to write a macro that pastes some data into a large number of csv files saved in a folder. How do I get the macro to select the first worksheet in each csv file (csv files only have one worksheet)? If it was an Excel file I could do this:
Sheets("Sheet1").Select
However, each csv file has a different name for the worksheet.
Upvotes: 0
Views: 2646
Reputation: 71227
Refer to it by its index instead of by name:
Sheets(1).Select
Upvotes: 3