Hello all,
I am using the below macro to find the data in to sheet2 and updated the same in sheet1.
i got " Type Mismatch Error"
Please Help...
Code :
Sheet1:
Sheet2:
Please Help...
I am using the below macro to find the data in to sheet2 and updated the same in sheet1.
i got " Type Mismatch Error"
Please Help...
Code :
Code:
Sub populate()
Dim LR As Long, i As Long, r As Long
With Sheets("Sheet1")
LR = .Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LR
With .Range("A" & i)
r = Application.Match(.Value, Sheets("Sheet2").Columns("A"), 0)
.Offset(, 1).Resize(, 3).Value = Sheets("Sheet2").Range("B" & r).Resize(, 3).Value
End With
Next i
End With
End Sub
Sheet1:
Excel Workbook | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Student | Mark1 | Mark2 | Mark3 | ||
2 | 1 | |||||
3 | 2 | |||||
4 | 3 | |||||
5 | 4 | |||||
6 | 5 | |||||
7 | 6 | |||||
8 | 7 | |||||
Sheet1 |
Sheet2:
Excel Workbook | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Student | Mark1 | Mark2 | Mark3 | ||
2 | 2 | 101 | 20 | 20 | ||
3 | 3 | 23 | 21 | 22 | ||
4 | 4 | 34 | 23 | 24 | ||
5 | 5 | 576 | 25 | 26 | ||
Sheet2 |
Please Help...