在VBA中,您可以使用以下方法引用变量作为Range的参数:
Dim rng As Range
Set rng = Range("A1:" & myVariable)
Dim rng As Range
Dim rngAddress As String
rngAddress = "A1:" & myVariable
Set rng = Range(rngAddress)
Dim rng As Range
Dim rowNum As Integer
Dim colNum As Integer
rowNum = 1
colNum = myVariable
Set rng = Cells(rowNum, colNum)
请根据您的具体情况选择适合的方法来引用变量作为Range的参数。