Set rExceptions = wbImport.Sheets(sSht).Range(Cells(rCell.Row, iHeadCol), _
Cells(rCell.Row, iLastCol))
You've qualified Range
, but not Cells
: either of these if not qualified with a specific sheet will refer to the ActiveSheet. Somewhat counter-intuitively, the (qualified) wrapping Range
doesn't "casade" down...
Try this:
With wbImport.Sheets(sSht)
Set rExceptions = .Range(.Cells(rCell.Row, iHeadCol), _
.Cells(rCell.Row, iLastCol))
End with