Extract multiple cells from multiple sheets in a workbook to a master sheet in the said workbook

ssincerely

New Member
Joined
Aug 27, 2012
Messages
31
Good Day,
Here is a challenge for the masters of excel (EXCELITES). I have a workbook with multiple sheets, all are formatted the same way and require the said information (SEE BELOW).

ABCDEFGI
2NAMEJOHN BROWNOFFENCELARCENY
3DOB27-3-72
4OCCUPATIONCARPENTER
5ADDRESS123 LOVE LANE
6TELEPHONE923-1723
DATE REPORTEDLAST DATENEXT DATE
2031-3-1824-3-18 17-5-18

<tbody>
</tbody>
The other cells are occupied or merge for other info etc.....


What I now want is a Mastersheet to generate with the information in RED ABOVE in rows (SEE BELOW)

ABCDEFGHI
1NAMEDOB OCCUPATIONADDRESSTELEPHONEOFFENCEDATE REPORTEDLAST DATENEXT DATE
2JOHN BROWN27-3-72CARPENTER123 LOVE LANE923-1723LARCENY31-3-1824-3-1817-5-18
3
4

<tbody>
</tbody>

Thanks in advance for any assistance that can even lead me in the right direction....Respect and Jah Love
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Note Data are in Cells C2 to C6, B20, E20, F20 and I2 on the first diagram.

Good Day,
Here is a challenge for the masters of excel (EXCELITES). I have a workbook with multiple sheets, all are formatted the same way and require the said information (SEE BELOW).

ABCDEFGI
2NAMEJOHN BROWNOFFENCELARCENY
3DOB27-3-72
4OCCUPATIONCARPENTER
5ADDRESS123 LOVE LANE
6TELEPHONE923-1723
DATE REPORTEDLAST DATENEXT DATE
2031-3-1824-3-18 17-5-18

<tbody>
</tbody>
The other cells are occupied or merge for other info etc.....


What I now want is a Mastersheet to generate with the information in RED ABOVE in rows (SEE BELOW)

ABCDEFGHI
1NAMEDOB OCCUPATIONADDRESSTELEPHONEOFFENCEDATE REPORTEDLAST DATENEXT DATE
2JOHN BROWN27-3-72CARPENTER123 LOVE LANE923-1723LARCENY31-3-1824-3-1817-5-18
3
4

<tbody>
</tbody>

Thanks in advance for any assistance that can even lead me in the right direction....Respect and Jah Love
 
Upvote 0
Hello SSincerely,

Try the following code in a standard module and assigned to a button:-

Code:
Option Explicit
Sub NotSure()

        Dim ws As Worksheet, sh As Worksheet
        Dim x As Long
        Dim cAr As Variant, pAr As Variant

        Set sh = Sheets("Master")
     
Application.ScreenUpdating = False
Application.DisplayAlerts = False

cAr = Array("C2", "C3", "C4", "C5", "C6", "B20", "E20", "F20", "I2")
pAr = Array("A", "B", "C", "D", "E", "F", "G", "H", "I")

For Each ws In Worksheets
If ws.Name <> "Master" Then
For x = LBound(cAr) To UBound(cAr)
        ws.Range(cAr(x)).Copy
        sh.Range(pAr(x) & Rows.Count).End(3)(2).PasteSpecial xlPasteValues
        sh.Columns.AutoFit
        Next x
End If
Next ws

Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Thanks for your response, something happened yes but it seems the special pasting didn't start in column A as also I wanted to eliminate about 3 sheets namely "Links", "Home Page", "personnel"

Hello SSincerely,

Try the following code in a standard module and assigned to a button:-

Code:
Option Explicit
Sub NotSure()

        Dim ws As Worksheet, sh As Worksheet
        Dim x As Long
        Dim cAr As Variant, pAr As Variant

        Set sh = Sheets("Master")
     
Application.ScreenUpdating = False
Application.DisplayAlerts = False

cAr = Array("C2", "C3", "C4", "C5", "C6", "B20", "E20", "F20", "I2")
pAr = Array("A", "B", "C", "D", "E", "F", "G", "H", "I")

For Each ws In Worksheets
If ws.Name <> "Master" Then
For x = LBound(cAr) To UBound(cAr)
        ws.Range(cAr(x)).Copy
        sh.Range(pAr(x) & Rows.Count).End(3)(2).PasteSpecial xlPasteValues
        sh.Columns.AutoFit
        Next x
End If
Next ws

Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Hello Ssincerely,
........as also I wanted to eliminate about 3 sheets namely "Links", "Home Page", "personnel"

This should have been made crystal clear in your opening post. You cannot assume that we explicitly know your thoughts.

Following is the code again with a couple of minor alterations to the arrays and the excluded worksheets:-
Code:
Option Explicit
Sub NotSure()

        Dim ws As Worksheet, sh As Worksheet
        Dim x As Long
        Dim cAr As Variant, pAr As Variant

        Set sh = Sheets("Master")
     
Application.ScreenUpdating = False
Application.DisplayAlerts = False

cAr = Array("C2", "C3", "C4", "C5", "C6", "I2", "B20", "E20", "F20")
pAr = Array("A", "B", "C", "D", "E", "F", "G", "H", "I")

For Each ws In Worksheets
If ws.Name <> "Master" And ws.Name <> "Links" And ws.Name <> "Home Page" And ws.Name <> "Personnel" Then
For x = LBound(cAr) To UBound(cAr)
        ws.Range(cAr(x)).Copy
        sh.Range(pAr(x) & Rows.Count).End(3)(2).PasteSpecial xlPasteValues
        sh.Columns.AutoFit
        Next x
End If
Next ws

Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub

Following is the link to a mock-up of what I believe your workbook to look like. You'll see that the code works just fine in doing its task:-

http://ge.tt/4BmM9Ep2

You will see that sheets "Master", "Links", "Home Page" and "Personnel" are excluded from the copy/paste and only data from sheets 2, 3 and 4 is transferred to the Master sheet. Click on the "RUN" button to see it work.

If you still experience any issues then please upload a sample of your workbook (an exact replica but with dummy data) to a free file sharing site such as ge.tt or Drop Box and then post the link to your file back here.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,215,218
Messages
6,123,676
Members
449,116
Latest member
HypnoFant

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