Hello,
I am trying to improve a tracking a sheet that we go in once a while and update the conditions. If the condition is 1 (meaning 100) then we want to paste into the "Wins" sheet for the selected ranges. The code I have works to paste the entire data when the condition is met, but when I click on the button to update, then it updates everything all over again. I would like to have it updated only once and the next available empty row on "Wins" sheet.
I tried two things:
1) this one runs and copies all the data
Private Sub CommandButton1_Click()
a = Worksheets("IC Pipeline").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("IC Pipeline").Cells(i, 11).Value = "1" Then
Worksheets("IC Pipeline").Rows(i).Copy
Worksheets("Wins").Activate
b = Worksheets("Wins").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Wins").Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("IC Pipeline").Activate
End If
Next
Application.CutCopyMode = False
ThisWorkbook.Worksheets("IC Pipeline").Cells(1, 1).Select
End Sub
2) This one gives me an error "Wrong number of arguments or invalid property assignment"
Private Sub CommandButton2_Click()
Dim LastRow As Integer, i As Integer, erow As Integer
LastRow = Worksheets("IC Pipeline").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To LastRow
If Worksheets("IC Pipeline").Cells(i, 11).Value = "1" Then
Range(Cells(i, 1), Cells(i, 2), Cells(i, 3), Cells(i, 4), Cells(i, 7), Cells(i, 8), Cells(i, 9), Cells(i, 10), Cells(i, 11), Cells(i, 12), Cells(i, 13), Cells(i, 14)).Select
Selection.Copy
Worksheets("Wins2").Activate
erow = Worksheets("Wins2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Worksheets("Wins2").Cells(erow, 1).Select
ActiveSheet.Paste
ThisWorkbook.Save
Application.CutCopyMode = False
End If
Next i
End Sub
*********
Can someone help me figure this out ??
Thank you!
ecelebi16
Bookmarks