Copy single column from different sheets and paste it in master sheet side by side

Status
Not open for further replies.

prashantkochar263

New Member
Joined
Jul 19, 2018
Messages
15
I have a workbook that has 500+ sheets naming sheet1, sheet 2,sheet3......sheet500...each sheet has multiple columns. I need to copy 'M column' of each sheet and paste it in a master sheet.
like from sheet1.. O column in master sheet in A Column, from sheet2 ..O column in master sheet in B column, from sheet 3.. O column in master sheet C column ...... llike that....
I am new to VBA.. AND REQUIREMENT THIS URGENT....

Sub NEW_COLUMNS()
'Modified 7/19/2018 2:19:06 AM EDT
Application.ScreenUpdating = False
Dim i As Long
Dim lastrow As Long
For i = 2 To Sheets.Count
lastrow = Sheets(i).Cells(Rows.Count, "O").End(xlUp).Row
Sheets("Master").Cells(1, i - 1).Resize(lastrow).Value = Sheets(i).Cells(1, "O").Resize(lastrow).Value
Next
Application.ScreenUpdating = True
End Sub


using the above script to get values of column O BUT After running getting only 256 columns and
error stating Application Defined or object defined error..
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Status
Not open for further replies.

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

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