Macro To Extract Data

vbabeginner92

New Member
Joined
Jul 25, 2018
Messages
13
I have a workbook that houses detailed metrics by project. In the front of the work is a summary tab with subsequent worksheets for the individual projects. I want to write a macro that will extract information from the individual project worksheets into the summary tab.

Example:

Row 1 Summary Worksheet - macro pulls certain information from worksheet 2 and puts in the summary worksheet
Row 2 Summary Worksheet - macro pulls same information as above but from worksheet 3 and puts in the next row in the summary worksheet
So on...until no more worksheets.

I know that I will need to use a loop. Anyone know how to write a macro will do as I describe above?

Sub UpdateData()
Dim WS_Count As Integer
Dim I As Integer


WS_Count = ActiveWorkbook.Worksheets.Count
For I = 1 To WS_Count

'Insert Data Extraction Macro


Next I
End Sub
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
What information/range do you want to pull from each worksheet? Do you want to pull the same range from each sheet?
 
Upvote 0
What information/range do you want to pull from each worksheet? Do you want to pull the same range from each sheet?

It comes from various cells throughout a worksheet and it is consistent for each worksheet (every worksheet is formatted the same and data are in the same cells).
 
Last edited:
Upvote 0
What are those various cells?
 
Upvote 0
I have a workbook that houses detailed metrics by project. In the front of the work is a summary tab with subsequent worksheets for the individual projects. I want to write a macro that will extract information from the individual project worksheets into the summary tab.

Example:

Row 1 Summary Worksheet - macro pulls certain information from worksheet 2 and puts in the summary worksheet
Row 2 Summary Worksheet - macro pulls same information as above but from worksheet 3 and puts in the next row in the summary worksheet
So on...until no more worksheets.

I know that I will need to use a loop. Anyone know how to write a macro will do as I describe above?

Sub UpdateData()
Dim WS_Count As Integer
Dim I As Integer


WS_Count = ActiveWorkbook.Worksheets.Count
For I = 1 To WS_Count

'Insert Data Extraction Macro


Next I
End Sub


With the information provided this is the best i can do for now but I think it should get you going.


Code:
Sub Go()
    sCell = "A1"            'Edit this to be your data source
    shSummary = "Summary"   'Edit this to be the name of your Summary tab
    sRow = Sheets(shSummary).UsedRange.Rows.Count
    For Each ws In ThisWorkbook.Sheets
        If ws.Name <> shSummary Then
            Sheets(shSummary).Cells(sRow, 1) = ws.Range(sCell)
            sRow = sRow + 1
        End If
    Next ws
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,394
Messages
6,119,263
Members
448,881
Latest member
Faxgirl

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