When i execute the following code:

Workbooks(ThisWorkbook.Name).Worksheets(Sheets(2).Name).Range("A10:I10").Select
I get a runtime error 9, subscript out of range.

Anyone have ideas as to why?

I do know that prior to running the macro, if i select the correct sheet then i do not get the error. HOwever, if i select the wrong sheet i do get the error. Why?