-1
Option Explicit

Sub value()

    Dim mynumber As Integer, mysum As Integer, myextra As Integer
    mynumber = Range("A2:A17")
    myextra = Range("B2:B17")
    mysum = mynumber * myextra
    MsgBox ("mysum")

End Sub

为什么我会得到Run time Error 13

4

1 回答 1

0

此错误表示存在类型不匹配。

确保范围实际上包含整数。

mynumber并且myextra应该通过带括号的名称声明为数组:

Dim mynumber() As Integer, mysum As Integer, myextra() As Integer
于 2013-11-03T12:31:49.820 回答