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..
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..