parscon
12-30-2013, 12:27 AM
Hello ,
I have a problem with row more than A65536 , I want to edit my below code like Range("A" & Rows.Count).End(xlUp)) but it does not work.
i have about 955000 row . Could you please help me to modify the below VBA .
Thank you for your help.
Sub moving()
Dim idx As Long
For Each d In Worksheets("Sheet1").Range("A1:A65536")
idx = 0
On Error Resume Next
idx = Application.Match(d.Value, Worksheets("Sheet2").Columns("A"), 0)
On Error Goto 0
If idx > 0 Then
Worksheets("Sheet2").Cells(idx, 1).Resize(1, 5).Copy _
Worksheets("Sheet3").Cells(Worksheets("Sheet3").Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
Next d
End Sub
I have a problem with row more than A65536 , I want to edit my below code like Range("A" & Rows.Count).End(xlUp)) but it does not work.
i have about 955000 row . Could you please help me to modify the below VBA .
Thank you for your help.
Sub moving()
Dim idx As Long
For Each d In Worksheets("Sheet1").Range("A1:A65536")
idx = 0
On Error Resume Next
idx = Application.Match(d.Value, Worksheets("Sheet2").Columns("A"), 0)
On Error Goto 0
If idx > 0 Then
Worksheets("Sheet2").Cells(idx, 1).Resize(1, 5).Copy _
Worksheets("Sheet3").Cells(Worksheets("Sheet3").Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
Next d
End Sub