循环给单元格赋值的问题!
Dim rRow As Long, Tol As Long, cols As Long, TValue As String, CValue As String
TValue = Target.Value
Tol = 0
cols = 1
rRow = Sheet3.UsedRange.Find("接入间").Row + 1
If Target.Address = "$H$3" Then
Set c = Sheet1.UsedRange.Find(TValue)
If Not c Is Nothing Then
firstAddress = c.Address
Do
CValue = c.Offset(0, -2)
Sheet3.Cells(rRow, cols).Value = CValue
Set c = Sheet1.UsedRange.FindNext(c)
cols = cols + 1
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End If
为什么我这一句老是出错 Sheet3.Cells(rRow, cols).Value = CValue 我都快疯了