我在Excel中有一个二维图表。我需要使用两个字符串变量来获取单元格的值。图表看起来是这样的:获取两个字符串变量的单元格值
Document person1 person2
Text1 5 8
Text2 2 1
Text3 9 6
网上找我发现在这之后很困难,因为:
- 的值是字符串,不是整数;
- 字符串将根据哪个人和文档组合出现而改变。
这应该是相关的唯一代码:假设文件和个人持有整数的字符串表示(是字符串变量
Dim document as string
Dim person as string
Dim oExcel as excel.application
Dim oWB as workbook
Set oExcel = New Excel.application
Set oWB = oExcel.Workbooks.open. ("C:")
oExcel.Visible = True
oWB.Sheets ("sheet1").Cells(documemt, person)