Copy paste repeat

tio2chem

New Member
Joined
Jul 22, 2019
Messages
2
I have a spreadsheet with over 80 tabs. I want to collect the contents of Columns B and C on each of those 80+ tabs and put it on 1 separate tab without copying and pasting 80+ times. In other words a macro but the macro recorder does seem to quite get the index to next tab and pasting at the bottom of the existing data.

Columns B (Name) + C (associated unique identifier number) are related and contain no more than 150 rows.
Any ideas on saving me 80+ copy/paste cycles?

I can always remove duplicates after I have all the data on one tab.

Thank you.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
a quick macro should do it....

assuming that the sheet you want to paste it to is the last sheet...

Code:
Sub SaveMyFingers()

Dim ws As Worksheet
Dim lng_ctr As Long

lng_ctr = 1


With Sheets(Sheets.Count)
For Each ws In ThisWorkbook.Worksheets

    .Range(.Cells(lng_ctr, 2).Address, .Cells(lng_ctr + 149, 3)).Value = _
    ws.Range(ws.Cells(1, 2).Address, ws.Cells(150, 3).Address).Value
    lng_ctr = lng_ctr + 150
Next ws
End With
End Sub
 
Last edited:
Upvote 0
a quick macro should do it....

assuming that the sheet you want to paste it to is the last sheet...

Code:
Sub SaveMyFingers()

Dim ws As Worksheet
Dim lng_ctr As Long

lng_ctr = 1


With Sheets(Sheets.Count)
For Each ws In ThisWorkbook.Worksheets

    .Range(.Cells(lng_ctr, 2).Address, .Cells(lng_ctr + 149, 3)).Value = _
    ws.Range(ws.Cells(1, 2).Address, ws.Cells(150, 3).Address).Value
    lng_ctr = lng_ctr + 150
Next ws
End With
End Sub


Thank you
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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