I would like to copy data from a CSV file into an Excel worksheet. There are 11 .csv files. So far I have this (it is a modified version from a previous post):
Set sh1 = Worksheets(filenum(lngPosition)).Activate
You are getting Subscript out of range error error becuase it cannot find that Worksheet.
Subscript out of range error
Also please... please... please do not use .Select/.Activate/Selection/ActiveCell You might want to see How to Avoid using Select in Excel VBA Macros.
.Select/.Activate/Selection/ActiveCell