Hello all,
I am using the below code to get data. i am using 1 Lakh data. Macro taking to much to time.
Sub UpdateData()
Application.ScreenUpdating = False
Dim LastRow As Long, desWS As Worksheet, srcWS As Worksheet, fnd As Range, ID As Range
Set desWS = Sheets("Sheet2")
Set srcWS = Sheets("Sheet1")
LastRow = desWS.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For Each ID In desWS.Range("A2:A" & LastRow)
Set fnd = srcWS.Range("A:A").Find(ID, LookIn:=xlValues, lookat:=xlWhole)
If Not fnd Is Nothing Then
fnd.Offset(0, 1).Resize(, 9).Copy ID.Offset(0, 1)
End If
Next ID
Application.ScreenUpdating = True
End Sub
I am using the below code to get data. i am using 1 Lakh data. Macro taking to much to time.
Sub UpdateData()
Application.ScreenUpdating = False
Dim LastRow As Long, desWS As Worksheet, srcWS As Worksheet, fnd As Range, ID As Range
Set desWS = Sheets("Sheet2")
Set srcWS = Sheets("Sheet1")
LastRow = desWS.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For Each ID In desWS.Range("A2:A" & LastRow)
Set fnd = srcWS.Range("A:A").Find(ID, LookIn:=xlValues, lookat:=xlWhole)
If Not fnd Is Nothing Then
fnd.Offset(0, 1).Resize(, 9).Copy ID.Offset(0, 1)
End If
Next ID
Application.ScreenUpdating = True
End Sub