ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbooks within a Folder - B-Lists (https://www.excelbanter.com/excel-programming/318802-workbooks-within-folder-b-lists.html)

Teresa

Workbooks within a Folder - B-Lists
 
I have the following situation:
I have a folder called B-List which is populated with Excel reports
every week
In the current spreadsheet I want to compare Job Numbers in Column 1
to the Job Numbers in Column 1 in the most recent spreadsheet
to see what has changed
So in the code below, before Range("A1:A18") I think I need to make a
reference
to this most recent spreadsheet, help is greatly appreciated.

Sub ma()
Dim i As Long
Dim j As Long

j = 1
With Sheets("Sheet1")
For i = 1 To 20
If IsError(Application.match(.Cells(i, 1), .Range("a1:a18"), 0))
Then
.Cells(i, 1).EntireRow.Copy
Destination:=Worksheets("Sheet3").Cells(j, 1)
j = j + 1
End If
Next
End With
End Sub




All times are GMT +1. The time now is 02:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com