KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 401
- Office Version
- 2016
- Platform
- Windows
Hi
I am using this VBA code to copy from one range to another. It works just fine. Can anyone help so it only copying if the number in column P is less than 58000.
Example:
In cell P2 stand 58000, so K2 should not be copied. In cell P10 stand 57000 is written, so K10 must be copied.
Any help will be appreciated
Best regards
Klaus W
I am using this VBA code to copy from one range to another. It works just fine. Can anyone help so it only copying if the number in column P is less than 58000.
Example:
In cell P2 stand 58000, so K2 should not be copied. In cell P10 stand 57000 is written, so K10 must be copied.
Any help will be appreciated
Best regards
Klaus W
VBA Code:
Sub Macro3()
Sheets("Worksheet").Range("k2:k400").Copy _
Destination:=Sheets("Worksheet").Range("b2")
Application.CutCopyMode = False
Sheets("Worksheet").Range("b2:b400").RemoveDuplicates _
Columns:=1, Header:=xlNo
End Sub