我分别定义了2个变量string和integer。使用需要的变量来引用单元格并采集数据。有人可以帮忙吗?
O(RlgN)
答案 0 :(得分:3)
尝试
Option Explicit
Public Sub TEST()
Dim OracleProjType As String
Dim SearchProjNameRow As Long
Dim OracleProjTypeData As String
OracleProjType = "C" '<==Assign the value to the variable
SearchProjNameRow = 6
With Worksheets("Sheet3") '<== Work with that sheet using with so no activate
OracleProjTypeData = .Range(OracleProjType & SearchProjNameRow).Value '<==Concatenate values to create range reference
Debug.Print OracleProjTypeData
End With
End Sub