Subscript out of range - how to assign variable to reference the cell in a worksheet

后端 未结 1 1678
孤城傲影
孤城傲影 2021-01-24 07:03

How do you correct assigna variable to store the reference to the cell ? Last line throws Subscript out of range error

Public Sub CommandButton1_Click()

Dim var         


        
相关标签:
1条回答
  • 2021-01-24 07:40

    Set variance = Sheets("ABC").Range("C6")

    +

    What is the difference between dim and set in vba

    +

    Subscript out of range means you do not have a sheet named ABC or the spelling/casing is different. Make sure it's not an Abc or ABc etc.

    0 讨论(0)
提交回复
热议问题