VBA Range from String

后端 未结 1 1387
無奈伤痛
無奈伤痛 2021-01-04 02:38

This is kind of silly, but I\'ve been stuck for a while in this simple statement:

    Dim range1 as Range
    Dim mysheet as String
    Dim myrange as String         


        
相关标签:
1条回答
  • 2021-01-04 03:14

    You need to use Set to assign objects:

    Set range1 = Worksheets(mysheet).Range(myrange)
    
    0 讨论(0)
提交回复
热议问题