The code below runs through and gives me the message box but doesn't paste everything below where it finds value W2 into the bottom of sheet1. Why?!?! I'm going crazy trying to work this one out!!!!!!!!!!
Sub test222()
Dim FindWord As String, Found As Range
Dim wsDest As Worksheet, ws As Worksheet, wb As Workbook
Dim Nextrow As Long, Lastrow As Long
Set ws = ThisWorkbook.Sheets("Sheet2")
Set wsDest = ThisWorkbook.Sheets("Sheet1")
FindWord = ThisWorkbook.Sheets("Sheet1").Range("W2").Value
Set Found = ws.Range("B:B").Cells.Find(What:=FindWord, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not Found Is Nothing Then
Nextrow = wsDest.Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1 ' Next empty row on Sheet1
Lastrow = ws.Cells.Find("*", , , , xlByRows, xlPrevious).Row ' Last used row on sheet2
' Copy\Paste found sheet2 data to the next empty row on Sheet1
ws.Range(Found, Found.End(xlToRight)).Resize(Lastrow - Found.Row + 1).Copy _
Destination:=wsDest.Range("B" & Nextrow)
End If
Application.ScreenUpdating = True
MsgBox "Copy complete.", vbInformation, "Copy Data"
End Sub
Bookmarks