Forum Discussion

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

VBA Code Working

Hi guys,   I got this code from https://www.youtube.com/watch?v=jGhkLeHMEUA&list=RDCMUCABOBqS3y8Xn_o7bXvH-j2Q&start_radio=1 and it keeps giving me an error (Run-time error '9': Subscript out of ran...
  • 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