Related:
- Compare two worksheet on conditional basis
- Beyond compare - Download - File management
- Transfer data from one excel worksheet to another automatically - Guide
- Excel compare two sheets - Guide
- How to automatically transfer data between sheets in Excel - Guide
- Grade formula in excel worksheet - Guide
1 response
Assumption:
There are no empty cells in the name column of the first worksheet you want to compare that have only the login name and dates.
Private Sub CommandButton2_Click()
Set s = Sheets("Sheet1") 'You can rename the sheets to match your sheet names
Set r = Sheets("Sheet2")
Dim i
Dim j
i = 2
j = 2
Do Until s.Range("A" & j) = ""
If s.Range("A" & i) = r.Range("A" & j) And s.Range("B" & i) = r.Range("B" & j) Then
s.Range("C" & i) = r.Range("C" & j)
s.Range("D" & i) = r.Range("D" & j)
s.Range("E" & i) = r.Range("E" & j)
s.Range("F" & i) = r.Range("F" & j)
s.Range("G" & i) = r.Range("G" & j)
s.Range("H" & i) = r.Range("H" & j)
s.Range("I" & i) = r.Range("I" & j)
End If
i = i + 1
j = j + 1
Loop
End Sub
There are no empty cells in the name column of the first worksheet you want to compare that have only the login name and dates.
Private Sub CommandButton2_Click()
Set s = Sheets("Sheet1") 'You can rename the sheets to match your sheet names
Set r = Sheets("Sheet2")
Dim i
Dim j
i = 2
j = 2
Do Until s.Range("A" & j) = ""
If s.Range("A" & i) = r.Range("A" & j) And s.Range("B" & i) = r.Range("B" & j) Then
s.Range("C" & i) = r.Range("C" & j)
s.Range("D" & i) = r.Range("D" & j)
s.Range("E" & i) = r.Range("E" & j)
s.Range("F" & i) = r.Range("F" & j)
s.Range("G" & i) = r.Range("G" & j)
s.Range("H" & i) = r.Range("H" & j)
s.Range("I" & i) = r.Range("I" & j)
End If
i = i + 1
j = j + 1
Loop
End Sub