I have searched and searched but cannot find the answer on how to do this. ALL THIS IS DONE FROM MY USERFORM (see pic). First my user will search for what they want (can use any of the purple buttons). The code returns the results to the listbox. Next the user will select the right PO from the listbox and the information populates the textboxes. All I need code for is, when the user clicks the Red reconcile button, the PO that is selected will be cut and the values are pasted to another sheet and then the row is deleted. Some other information you might find useful. My source data resides in a table called T-Inv on a sheet called Purchase Orders. There is a header row at A14, the data starts at A15:Y15 . The destination table is called Table5 on a sheet called Reconciled. There is a header row in A1 and the data can start to be pasted at A2. I have looked at a lot of different codes and questions and none of them seem to quite do what I want.
This is working but it is looking for a "Y" in column 25. I want to eliminate this step for the user. Currently the user puts a "Y" in the reconciled box (see pic) then hits update then hits reconcile. I want the user to just be able to click reconcile and be done.
VBA Code:
Private Sub CmdRecon_Click()
Dim i As Long
For i = Cells(Rows.Count, 25).End(xlUp).Row To 1 Step -1
If Cells(i, 25) = "y" Then
Range("a" & i & ":Y" & i).Copy
Sheet3.Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial xlPasteValues
Cells(i, 25).EntireRow.Delete
End If
Next
End Sub
This is working but it is looking for a "Y" in column 25. I want to eliminate this step for the user. Currently the user puts a "Y" in the reconciled box (see pic) then hits update then hits reconcile. I want the user to just be able to click reconcile and be done.