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

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
Sachin SinghAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sachin SinghAuthor Commented:
Thnx Neeraj Sir for ur great support
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Welcome Sachin!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.