Copy for cells from all sheets and paste in to 1 sheet

gssachin

Board Regular
Joined
Nov 14, 2013
Messages
155
hi,

I have excel workbook for 90 sheets and each sheet "B5" cell contain employee number and "E185" cell contain "Amount"

I want to copy emp number & amount from all worksheets to 1 master sheet in column a2 and column b2

thanks in advance...
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Assuming you have a sheet named "Master"
Which is the first Worksheet in your Workbook

Try using this script:
VBA Code:
Sub Copy_Name_Amount()
'Modified 4/6/2021  2:20:08 AM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Sheets("Master").Cells(Rows.Count, "A").End(xlUp).Row + 1

    For i = 2 To Sheets.Count
        With Sheets(i)
            .Range("B5").Copy Sheets("Master").Cells(Lastrow, 1)
            .Range("E185").Copy Sheets("Master").Cells(Lastrow, 2): Lastrow = Lastrow + 1
        End With
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,537
Members
449,316
Latest member
sravya

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