Hi All,
I am almost there! I have code finding a value (Label5) from userform5 and finding that value in a spreadsheet (Pipeline) then cutting that row.
Where I am stuck is how to then get it to paste that data in the last row of worksheet (B&P Archive). I cant seem to apply anything I've found searching to my instance. I am also going to have it do the cut and paste in another worksheet that's why you see the SS designations.
Thanks in advance!
Here is what I have so far:
Private Sub CommandButton1_Click()Dim strFind
Set ws = Worksheets("Pipeline")
Set ws1 = Worksheets("SS")
Set ws2 = Worksheets("B&P Archive")
Set rSearch = ThisWorkbook.Worksheets("Pipeline").Range("B1:B300")
Set rSearchSS = ThisWorkbook.Worksheets("SS").Range("B1:B300")
Dim Nullstring
Dim BPArchive As String
Dim rSearch As Range 'range to search
Dim rSearchSS As Range 'range to search
Dim rngFind
strFind = UserForm5.Label5
If strFind = Nullstring Then GoTo error1
With rSearch
Set rngFind = .Find(What:=strFind, MatchCase:=True)
If Not rngFind Is Nothing Then 'found it
ws.Select
rngFind.EntireRow.Copy
ThisWorkbook.Worksheets("B&P Archive").Select
error1:
End If
End With
End Sub
Bookmarks