Forum Discussion

ClaudeV2240's avatar
ClaudeV2240
Copper Contributor
Oct 06, 2022
Solved

VBA Code Working

Hi guys,   I got this code from YouTube Video and it keeps giving me an error (Run-time error '9': Subscript out of range) on line 66.  I have: double checked the code - it seems fine I have inc...
  • OliverScheurich's avatar
    Oct 06, 2022

    ClaudeV2240 

    Does the error appear for i = 13?

    Line 66 of the code refers to a worksheet named according to the value in ThisWorkbook.Sheets(sh.cells(2, i).value) which would be ThisWorkbook.Sheets("ATHLONE EXPRESS BLACK") for i = 13.

    According to your screenshot there isn't a worksheet named "ATHLONE EXPRESS BLACK" which would explain the error message.

     

Resources