Hi all
I want to have macro do that:
find each cell in sheet(3144).column(B) with value = "R-101" then
Copy range(Ei:Ni) to sheets(02).range(Cz:Lz)
Copy 8th characters from range (Ai) to sheets(02).range(Bz)
with: i = 2 to last row in sheet(3144)
and z = 10 to last row in sheets(02)
My code belove don't work, please help me
I want to have macro do that:
find each cell in sheet(3144).column(B) with value = "R-101" then
Copy range(Ei:Ni) to sheets(02).range(Cz:Lz)
Copy 8th characters from range (Ai) to sheets(02).range(Bz)
with: i = 2 to last row in sheet(3144)
and z = 10 to last row in sheets(02)
My code belove don't work, please help me
Code:
Sub Copy()Dim lrowa As Long, j As Long, z As Long
With Sheets("3144")
lrowa = .Cells(Rows.Count, 1).End(xlUp).Row
For j = 2 To lrowa
For z = 10 To Sheets("02").Cells(Rows.Count, "C").End(xlUp).Row
If .Cells(j, "B").Value = "R-101" Then
.Range(.Cells(j, "E"), .Cells(j, "N")).Copy Sheets("02").Range("C" & z)
Sheets("02").Range("B" & z).Value = Mid(.Range("A" & j), 8, 8)
End If
Next z
Next j
End With
End Sub