Hello, I found some code that generally does what I want it to do but I need to open another workbook as the source rather than a sheet from the active workbook. I keep reading that I can't have two active workbook so not sure how to adapt this code.
Sub testing()
Dim c As Range
Dim j As Integer
Dim Source As Worksheet
Dim Target As Worksheet
' Change worksheet designations as needed
Set Source = ActiveWorkbook.Worksheets("Sheet1")
Set Target = ActiveWorkbook.Worksheets("Sheet2")
j = 1 ' Start copying to row 1 in target sheet
For Each c In Source.Range("A1:A20000") ' Do 1000 rows
If c = "17513" Then
Source.Rows(c.Row).Copy Target.Rows(j)
j = j + 1
End If
Next c
End Sub
The source workbook is always in the same directory with a name that doesn't change. Also I'd like to change the C value to the value of a cell in the destination worksheet.
Thank you for taking the time to read this and for any help or advice.
Bookmarks