ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Runtime Error '9' Subscript out of range HELP (https://www.excelbanter.com/excel-programming/369151-runtime-error-9-subscript-out-range-help.html)

Brandon Johnson

Runtime Error '9' Subscript out of range HELP
 
Im having this error pop up at such a random time in my app. I have a
combo box with 13 items listed. I have a onclick change event for the
combo box and every index works except for the 8th index. After
clicking that index, the runtime Error pops up. Anyone have any clue
what this may be?

The onclick change event is as follows:
upcName is a string and cboUPCS is the name of the combo box

upcName = cboUPCS
Worksheets(upcName).Activate


Dave Peterson

Runtime Error '9' Subscript out of range HELP
 
It sounds like cboUPCS doesn't have a value that corresponds to a worksheet
name.

Maybe extra spaces?

Brandon Johnson wrote:

Im having this error pop up at such a random time in my app. I have a
combo box with 13 items listed. I have a onclick change event for the
combo box and every index works except for the 8th index. After
clicking that index, the runtime Error pops up. Anyone have any clue
what this may be?

The onclick change event is as follows:
upcName is a string and cboUPCS is the name of the combo box

upcName = cboUPCS
Worksheets(upcName).Activate


--

Dave Peterson


All times are GMT +1. The time now is 02:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com