Hello All,
I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is glitchy, probably due to the multiple activate sheets portion. However, I need to add in the capability of clearing non-duplicate on the "2B Board Items" work sheet after every click of the command button. For instance if a cell from Column D of "All Data" is the same as a cell from column D for "2B Board Items" then don't delete it. Any help is appreciated.
Also any help on making the Macro more efficient would be appreciated
I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is glitchy, probably due to the multiple activate sheets portion. However, I need to add in the capability of clearing non-duplicate on the "2B Board Items" work sheet after every click of the command button. For instance if a cell from Column D of "All Data" is the same as a cell from column D for "2B Board Items" then don't delete it. Any help is appreciated.
Also any help on making the Macro more efficient would be appreciated
VBA Code:
Private Sub CommandButton2_Click()
a = Worksheets("All Data").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("All Data").Cells(i, 8).Value > 0 Then
Worksheets("All Data").Rows(i).Copy
Worksheets("2B Board Items").Activate
b = Worksheets("2B Board Items").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("2B Board Items").Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("All Data").Activate
End If
Application.CutCopyMode = False
Next
Worksheets("2B Board Items").Activate
ThisWorkbook.Worksheets("2B Board Items").Cells(1, 1).Select
End Sub