Hi - I'm trying to pull data from various workbooks using vba, but seem to get a run time error 91 after the first workbook has opened. This is my code:
Sub ImportBnHData()
Dim strFilePath As String
Dim wbTemp As Workbook
Dim i As Integer
For i = 1 To 13
strFilePath = [BacktestingDataFolder] & [BnHDataFiles].Offset(i, 1) & ".xlsx"
wbTemp = Workbooks.Open(strFilePath)
wbTemp.Sheets("Summary").Activate
Next I
[BacktestingDataFolder] & [BnHDataFiles] are named ranges in the spreadsheet that I am using. Any help would be great!
Thanks,
P
Bookmarks