Retrieve data from different sheets

  • Thread starter Thread starter dannyboy213
  • Start date Start date
D

dannyboy213

How do I get datas from ALL of the worksheet within the file into
"master worksheet". REMEMBER ALL WORKSHEETS

In the master worksheet:
Column A = worksheet name (example "Sheet 1")
Column B = get data in cell B1 from each worksheet
Column C = get data in cell B2 from each worksheet
Column D = get data in cell B3 from each worksheet
Column E = get data in cell K20 from each worksheet
Column F = get data in cell C26 from each workshee
 
Public Sub LoadFromWorksheets()
Dim Wks As Worksheet
Dim iRow As Integer

iRow = 1
For Each Wks In Application.ActiveWorkbook.Worksheets
If Wks.Name <> "Master" Then
Sheet1.Cells(iRow, 1).Value = Wks.Name
Sheet1.Cells(iRow, 2).Value = Wks.Cells(1, 2).Value
Sheet1.Cells(iRow, 3).Value = Wks.Cells(2, 2).Value
Sheet1.Cells(iRow, 4).Value = Wks.Cells(3, 2).Value
Sheet1.Cells(iRow, 5).Value = Wks.Cells(20, 11).Value
Sheet1.Cells(iRow, 6).Value = Wks.Cells(26, 3).Value
iRow = iRow + 1
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top