- 帖子
- 11
- 主題
- 4
- 精華
- 0
- 積分
- 15
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office 2007
- 閱讀權限
- 10
- 性別
- 女
- 註冊時間
- 2014-2-22
- 最後登錄
- 2014-5-2
|
那個抱歉
請問那是 ? 要怎麼用?
Private Sub CommandButton1_Click()
Dim i As Integer
Dim strB, strC As Range
For i = [B2].End(xlDown).Row To 2 Step -1
Set strB = Cells(i - 1, 2)
Set strC = Cells(i, 2)
If strC.Value = strB.Value Then
If strB.Offset(0, 1) = "" And strC.Offset(0, 1) <> "" Then
strB.Offset(0, 1) = strC.Offset(0, 1)
End If
If strB.Offset(0, 2).Value = "" And strC.Offset(0, 2).Value <> "" Then
strB.Offset(0, 2).Value = strC.Offset(0, 2).Value
End If
strC.EntireRow.Delete
End If
Next
End Sub |
|