Guide to vba subscript out of range.
Excel subscript out of range runtime error 9.
Cause origin of hardware.
If you receive a message that says run time error 9.
Is it nor available for using old generations visualbasic.
Run time does my excel version have an reduced functionality.
Are not all subscript built in.
Compatibiliy can i do something to solve this problem.
Option explicit sub copycolumn const file1 as string c testfile1 xlsx const file2 as string c testfile2 xlsx const sheet1 as string sheet2 const sheet2 as string sheet1 const col1 as string a const col2 as string d dim wb1 as workbook wb2 as workbook wb as workbook wbinfo as string dim ws1 as worksheet ws2 as worksheet ws as worksheet dim sourcecolumn as range.
Home and student version 2016 is it a software bug.
If it s a excel 2010 file like you indicate you may need to update your code to reflect the extension of your rite 1624 file e g.
How can i fix this.
70 countries indicators 1 nsb 1 xlsm 0 99 mo jean eric fanatique d excel messages 17 018.
Forums excel vba run time error 9 subscript out of range.
As i pointed out the code worked when a single worksheet was opened.
Xlsx for a 2010 excel workbook xlsm for a 2010 excel macro enabled workbook or whatever the extension is.
My belief is that excel is opening all the workbooks before executing any code thus it was attempting to select a sheet not available in the workbook that was active.
The problem was only evident when multiple worksheets were opened.
Here we learned the error called subscript out of range run time error 9 in excel vba.
Sub bringupworkbook workbooks rite 1624 xlsx activate end sub.
Make sure the extension is correct.
Subscript out of range that means visual basic is unable to read.