Hi, I want to specify a sheet with varible i:
i = wbkCur.Worksheets("Openwbk").Range("d6")
FileName = "C:\Users\Lele\" & i & ".xlsx"
Set wbkNew = Workbooks.Open(FileName:=FileName)
With Sheets(i)
.Rows("1:1").Insert Shift:=xlDown
It gave the error of "Subscript out of range", at sentence "With Sheets(i)". Please help.
Thx,
Rachel
i = wbkCur.Worksheets("Openwbk").Range("d6")
FileName = "C:\Users\Lele\" & i & ".xlsx"
Set wbkNew = Workbooks.Open(FileName:=FileName)
With Sheets(i)
.Rows("1:1").Insert Shift:=xlDown
It gave the error of "Subscript out of range", at sentence "With Sheets(i)". Please help.
Thx,
Rachel
Last edited: