How to copy a column from one sheet to another

nehachoubey

Board Regular
Joined
Aug 17, 2011
Messages
52
HI,
I have to copy one column from 3 different sheets to one sheet. Details are:

Copy from: DATA(Column B), SCREEN(Column B), SUMMARY(Column C) sheets
Copy to: LABELS(Column B)

I dont know how many cells will be there in those 3 sheets. Plz reply.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try

Code:
Sub test()
Dim LR As Long
LR = Sheets("DATA").Range("B" & Rows.Count).End(xlUp).Row
Sheets("Data").Range("B1:B" & LR).Copy Destination:=Sheets("LABELS").Range("B" & Rows.Count).End(xlUp).Offset(1)
LR = Sheets("SCREEN").Range("B" & Rows.Count).End(xlUp).Row
Sheets("SCREEN").Range("B1:B" & LR).Copy Destination:=Sheets("LABELS").Range("B" & Rows.Count).End(xlUp).Offset(1)
LR = Sheets("SUMMARY").Range("C" & Rows.Count).End(xlUp).Row
Sheets("SUMMARY").Range("C1:C" & LR).Copy Destination:=Sheets("LABELS").Range("B" & Rows.Count).End(xlUp).Offset(1)
End Sub
 
Upvote 0
:confused:Hi,

I have some query:

1. The Data which is from column B (data),Column B (Screen) and Column C (Summary). All 3 columns should be display in Column B..? or it should be in different columns..
 
Upvote 0
try

Code:
Sub test()
    Dim a(2) As Variant, r As Range, i As Integer
    a(0) = "Data,b:b"
    a(1) = "screen,b:b"
    a(2) = "summary,c:c"
    For i = 0 To 2
        Set ws = Sheets(Split(a(i), ",")(0))
        Set r = Intersect(ws.UsedRange, ws.Range(Split(a(i), ",")(1)))
        r.Copy Sheets("labels").Cells(Rows.Count, "B").End(xlUp).Offset(1)
    Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,958
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top