Excel data from same cells in different worksheets

canadian86

Board Regular
Joined
Feb 6, 2011
Messages
53
Hi,

I have 3 sheets called:

Sheet1
Sheet2
Sheet3

In all 3 sheets, I have a mailing address in cells:

A1
A2
A3
A4

I want to extract cells A1-4 from each sheet and put it ALL in one sheet. Essentially, I am trying to compile all the addresses in one sheet.

Any ideas how I can do that?

Thanks!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Maybe like this

Code:
Sub GetData()
Dim ws As Worksheet
For Each ws In Worksheets(Array("Sheet1", "Sheet2", "Sheet3"))
    ws.Range("A1:A4").Copy Destination:=Sheets("Sheet4").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next ws
End Sub
 
Upvote 0
Is there any way to do with with VB? I have all the sheet names and am looking for an output that looks like this:


-- removed inline image ---
<table style="width: 439px; height: 128px;" border="0" cellpadding="0" cellspacing="0"><colgroup><col style="mso-width-source:userset;mso-width-alt:7204;width:148pt" width="197"> <col style="mso-width-source:userset;mso-width-alt:1682; width:35pt" span="3" width="46"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl234" style="height:15.0pt;width:148pt" height="20" width="197">
</td> <td class="xl234" style="border-left:none;width:35pt" width="46">Sheet1</td> <td class="xl234" style="border-left:none;width:35pt" width="46">Sheet2</td> <td class="xl234" style="border-left:none;width:35pt" width="46">Sheet3</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl234" style="height:15.0pt;border-top:none" height="20">Address Line 1 (located in cell A1)</td> <td class="xl234" style="border-top:none;border-left:none">
</td> <td class="xl234" style="border-top:none;border-left:none">
</td> <td class="xl234" style="border-top:none;border-left:none">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl234" style="height:15.0pt;border-top:none" height="20">Address Line 2 (located in cell A2)</td> <td class="xl234" style="border-top:none;border-left:none">
</td> <td class="xl234" style="border-top:none;border-left:none">
</td> <td class="xl234" style="border-top:none;border-left:none">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl234" style="height:15.0pt;border-top:none" height="20">Address Line 3 (located in cell A3)</td> <td class="xl234" style="border-top:none;border-left:none">
</td> <td class="xl234" style="border-top:none;border-left:none">
</td> <td class="xl234" style="border-top:none;border-left:none">
</td> </tr> </tbody></table>

-- removed inline image ---
 
Upvote 0
I was thinking if there's a way to do it using the INDIRECT function? I can't seem to make it work.. but if I could have the cell look into a sheet name that is located in a certain cell, and pull data from a specific cell in that sheet.
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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