我正在嘗試創建一個審計跟蹤數據庫,並設法制定一些代碼將每行代碼分配到第2張表格,但是我已倒在最後,並且無法計算出如何粘貼值?粘貼特殊值 - 僅限值
這是我的代碼到目前爲止;任何幫助非常感謝
Private Sub Worksheet_Change(ByVal Target As Range)
Dim nxtRow As Integer, b As Boolean
'Determine if change was to Column I (9)
If Target.Column = 9 Then
'If Yes, Determine if cell >= 1
If IsError(Target.Value) Then
b = True
Else
If Target.Value >= 1 Then
b = True
Else
b = False
End If
End If
If b Then
'If Yes, find next empty row in Sheet 2
nxtRow = Sheets(2).Range("A" & Rows.Count).End(xlUp).Row + 1
'Copy changed row and paste into Sheet 2
Target.EntireRow.Copy _
Destination:=Sheets(2).Range("A" & nxtRow)
End If
End If
End Sub
感謝 馬特
我注意到在你的代碼中的一些嚴重的錯誤,但我不認爲如果我糾正它們可以解決您的問題。無論如何,要我把它作爲答案? – 2014-09-24 11:14:05
是的,越穩定越好,從谷歌的工作中把這個拉到一起 – Matt 2014-09-24 11:18:47