Move all cells from all tabs into one column

customesp

New Member
Joined
Oct 11, 2013
Messages
34
Hello All!

Is there a macro to take every cell value from all my tabs (about 40) and send it to Sheet1, for example, in a single column?

Thanks,

Neil
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
It would be helpful to know how the data in your 40 sheets is organized. If it is multiple rows and columns, do you want the values copied to the column in Sheet1 by rows or by columns? Please clarify.
 
Upvote 0
The data in the 40 sheets is strictly cell values randomly placed in an area that doesn't exceed row 100 or column CV (100x100) and I need all these cells moved to Sheet 1 column A. Let me know if you have any further questions. Thanks in advance.
 
Upvote 0
Try:
Code:
Sub CopyCells()
    Application.ScreenUpdating = False
    Dim rng As Range
    Dim ws As Worksheet
    For Each ws In Sheets
        If ws.Name <> "Sheet1" Then
            For Each rng In ws.UsedRange
                If rng <> "" Then
                    Sheets("Sheet1").Cells(Sheets("Sheet1").Rows.Count, "A").End(xlUp).Offset(1, 0) = rng
                End If
            Next rng
        End If
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Try:
Code:
Sub CopyCells()
    Application.ScreenUpdating = False
    Dim rng As Range
    Dim ws As Worksheet
    For Each ws In Sheets
        If ws.Name <> "Sheet1" Then
            For Each rng In ws.UsedRange
                If rng <> "" Then
                    Sheets("Sheet1").Cells(Sheets("Sheet1").Rows.Count, "A").End(xlUp).Offset(1, 0) = rng
                End If
            Next rng
        End If
    Next ws
    Application.ScreenUpdating = True
End Sub


Thanks for the response but I get an error stating "Can't execute code in break mode". :(
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,318
Members
449,218
Latest member
Excel Master

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