copy data from 40 sheets to one consolidated sheet in different columns

N Prakash

Active Member
Joined
Nov 7, 2003
Messages
409
Hi,

I have 40 different sheets of data and data is in column A only in each sheet. I need to create a consolidated sheet by copying data from each sheet (Column A only) to a different sheet in 40 different columns. I was looking for Macro code and I was unable to find one. Can anybody help me please.

Thanks in advance,
Prakash
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
What are the name of the sheets you are copying from and what is the name of the sheet you are copying to?

What cell should the data first copy to - A1?
 
Upvote 0
I have 40 sheets with following names r1c2 r1l1 r1l2 r1r1 r1r2 r2c1 r2c2 r2l1 r2l2 r2r1 r2r2 r3c1 r3c2 r3l1 r3l2 r3r1 r3r2 r4c1 r4c2 r4l1 r4l2 r4r1 r4r2 r5c1 r5c2 r5l1 r5l2 r5r1 r5r2 r6c1 r6c2 r6l1 r6l2 r6r1 r6r2 pi1 pi2 pi3 pi4 r1c1. Data is there only in column A with sheet name as header of each column A. Macro code should copy and paste from each sheet only data from column A and put it into the consolidated sheet in 40 different columns. Hope I have made it clear.
 
Upvote 0
What is the name of the sheet you are copying the data to?
 
Upvote 0
I am creating a new sheet "consolidated" or macro code itself can create a new sheet and copy from sheets r1c2, r1l1, r1l2, r1r1, r1r2, r2c1 etc., etc.,
 
Upvote 0
This is returning error for me. Without Browse by just entering other options it is prompting to browse. If I open new workbook and try to browse, the file is not being displayed in the folder. Am I doing anything wrong.
 
Upvote 0
It did not work. It has created a log file with error and file names are in a column. What I need is I have 40 sheets with data in column A and each data is more than 1000 rows. I want code should loop through all sheets and copy A column from each sheet in a new single sheet in different 40 columns from 40 individual sheets.
 
Upvote 0
Does this do what you want?
Code:
Sub CopyColA()

    Dim Cnt As Long
    Dim Sht As Worksheet
    Dim Shts As Long
    
    Shts = Sheets.Count
    Sheets.Add after:=Sheets(Shts)
    Set Sht = Sheets(Shts + 1)
    
    For Cnt = 1 To Shts
        Sheets(Cnt).Columns(1).Copy Sht.Columns(Cnt)
    Next Cnt

End Sub
 
Upvote 0
Thanks a ton Mr. Fluff. I was struggling since 2 days. It met my requirements. Thanks all who responded to the thread.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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