Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, Rng As Range
If Target.Column = 1 Then
With Sheets("工作表1")
For i = 1 To .UsedRange.Rows.Count
Set A = .UsedRange.Rows(i).Find(Target)
If Not A Is Nothing Then
If Rng Is Nothing Then
Set Rng = .UsedRange.Rows(i)
Else
Set Rng = Union(Rng, .UsedRange.Rows(i))
End If
End If
Next
End With
End If
If Not Rng Is Nothing Then Rng.Copy Target.Offset(, 1)
End Sub
請問
1)如何將尋找範圍規定某一欄,不是全部都在尋找範圍。
2)If Target.Column = 1 Then 可否改成指定某個字嗎?例如:Target = "TT"
3)可否設定幾個尋找的規則嗎?例如:Client = "John" Payment term = “TT” ORIGIN = "USA"
4)可否只是copy 符合規格的某幾個欄的資料嗎?不是全部資料都copy 過去。例如 A 欄,C欄,E欄,其他的都不要。