我正在电子表格中使用Visual Basic代码。它正在调用电子表格中的特定单元格。我不明白为什么我可以使用以下代码调用单元格A3:A5,但不能调用A21:A23。我仅以对A21的呼叫为例。
错误告诉我:
类型不匹配
Sub WriteDataToTsin1(FileIn)
Dim A21 As Double
Dim A4 As Single
Dim A5 As Single
'Dim A6 As Single
A21 = Cells(22, 1)
A4 = Cells(4, 1)
A5 = Cells(5, 1)
'A6 = Cells(36, 1)
Open FileIn For Output As #1
Write #1, A21, A4, A5
Close #1
End Sub