Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim wsCopy2 As Worksheet
- Dim wsDest2 As Worksheet
- Dim i As Integer
- Dim inrow As Integer
- Dim inmatch As String
- Dim inpax As Integer
- Dim k As Integer
- Dim outrow As Integer
- Dim outmatch As String
- Set wsCopy2= Workbooks("CargoReport1.xlsx").Worksheets("CargoReport")
- Set wsDest2 = Workbooks("w1.xlsm").Worksheets("Sheet1")
- If wsCopy2.Range("c2") > 0 Then
- inrow = 1000
- For i = 2 To inrow
- inmatch = wsCopy2.Range("d" & i)
- If inmatch = "" Then
- Exit For
- outrow = 1000
- For k = 2 To outrow
- outmatch = wsDest2.Range("A" & k)
- If outmatch = inmatch Then
- Exit For
- End If
- If outmatch = "" Then
- wsDest2.Range("A" & k) = inmatch
- Exit For
- End If
- Next
- If outmatch = inmatch Then
- Exit For
- End If
- Next
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement