K
K
I am trying to make below macro work but there is something not
correct. I am getting error on line
Worksheets("Sheet3").Cells(row3, Range("A" & row3 & ":C" & row3)) =
Worksheets("Sheet1").Cells(row1, Range("B" & row1 & "" & row1))
Please can any body can help
Sub CheckInfo()
Dim row1, row2, row3 As Integer
row3 = 2 ' Sheet3
row2 = 2 ' Sheet2
While Worksheets("Sheet2").Cells(row2, 1) <> ""
row1 = 2 ' Sheet1
While Worksheets("Sheet1").Cells(row1, 1) <> ""
If Worksheets("Sheet1").Cells(row1, 1) = Worksheets("Sheet2").Cells
(row2, 1) Then
Worksheets("Sheet3").Cells(row3, Range("A" & row3 & ":C" & row3)) =
Worksheets("Sheet1").Cells(row1, Range("B" & row1 & "" & row1))
row3 = row3 + 1
End If
row1 = row1 + 1
Wend
row2 = row2 + 1
Wend
End Sub
correct. I am getting error on line
Worksheets("Sheet3").Cells(row3, Range("A" & row3 & ":C" & row3)) =
Worksheets("Sheet1").Cells(row1, Range("B" & row1 & "" & row1))
Please can any body can help
Sub CheckInfo()
Dim row1, row2, row3 As Integer
row3 = 2 ' Sheet3
row2 = 2 ' Sheet2
While Worksheets("Sheet2").Cells(row2, 1) <> ""
row1 = 2 ' Sheet1
While Worksheets("Sheet1").Cells(row1, 1) <> ""
If Worksheets("Sheet1").Cells(row1, 1) = Worksheets("Sheet2").Cells
(row2, 1) Then
Worksheets("Sheet3").Cells(row3, Range("A" & row3 & ":C" & row3)) =
Worksheets("Sheet1").Cells(row1, Range("B" & row1 & "" & row1))
row3 = row3 + 1
End If
row1 = row1 + 1
Wend
row2 = row2 + 1
Wend
End Sub