Copy column B data of sheet1 and sheet2 1st row and 2nd row  and paste the data to sheet3

Sachin Singh
Sachin Singh used Ask the Experts™
on
Copy column B data of sheet1 and sheet2 1st row and 2nd row  and paste the data to sheet3
see the sample file
OneClick.xlsb
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015
Commented:
Please give this a try...

Sub CopySheet1AndSheet2ToSheet3()
Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Dim lr As Long, dlr As Long, i As Long

Application.ScreenUpdating = False
Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")
Set ws3 = Sheets("Sheet3")
ws3.Cells.Clear
lr = ws1.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lr
    ws2.Range("C1:C2").Value = ws1.Cells(i, 2).Value
    If ws3.Range("A1").Value = "" Then
        dlr = 1
    Else
        dlr = ws3.Range("A" & Rows.Count).End(3)(2).Row
    End If
    ws2.Range("A1:T2").Copy ws3.Range("A" & dlr)
Next i
ws2.Range("C1:C2").Clear
Application.ScreenUpdating = True
End Sub

Open in new window

Author

Commented:
Thnx Neeraj Sir for ur great support
Subodh Tiwari (Neeraj)Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015

Commented:
Welcome Sachin!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial