Private Sub cmd1_Click()
Dim cell1 As Range
Dim cell2 As Range
Dim sheet As Worksheet
Dim value1 As String
Dim value2 As String
Dim i As Long
Set sheet = ActiveSheet
For Each cell1 In sheet.Columns(1)
If Not IsEmpty(cell1.Value) Then
For Each cell2 In sheet.Columns(2)
If Not IsEmpty(cell2.Value) Then
value1 = CStr(cell1.Value) //?????????????????????
value2 = CStr(cell2.Value)
If value2 = value1 Then
i = i + 1
heet.Columns(3)(i).Value = cell2.Value
End If
End If
Next
End If
Next
End Sub
为什么运行到这名出现类型不匹配的错误,晕了,有什么方法解决