multi sheet reference for 1 cell/Impossible??

August

Active Member
Joined
Jun 18, 2004
Messages
270
I have an excel doc with several worksheets
1 summary sheet
The rest are all different addresses, the address in each sheet is in cell B2
I would like a formula in the summary sheet the give the address in cell B2 and be able to drag the formula down to give the addresses for each different sheet

There is a add on for excel called Kutools that does it and I'm prepared to pay for that but would rather be able to do it and understand it myself

Thanks in advance
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
If I understand your request correctly, you want a formula that displays the contents of cell B2 on any given sheet. If that is correct, you can use this UDF (user defined function) to do it...
Code:
Function GetB2(SheetNum As Long) As String
  On Error GoTo NoSuchSheet
  GetB2 = Sheets(SheetNum).Range("B2")
NoSuchSheet:
End Function

HOW TO INSTALL UDFs
------------------------------------
If you are new to UDFs, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. You can now use GetB2 just like it was a built-in Excel function. For example, assuming your summary sheet is the first sheet so that you want to start listing from the second sheet onward, put this formula in your starter cell and then copy it down...

=GetB2(ROWS($1:2))

If you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
 
Last edited:
Upvote 0
Wow, that works perfectly
Thank you so much for taking the time to help



If I understand your request correctly, you want a formula that displays the contents of cell B2 on any given sheet. If that is correct, you can use this UDF (user defined function) to do it...
Code:
Function GetB2(SheetNum As Long) As String
  On Error GoTo NoSuchSheet
  GetB2 = Sheets(SheetNum).Range("B2")
NoSuchSheet:
End Function

HOW TO INSTALL UDFs
------------------------------------
If you are new to UDFs, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. You can now use GetB2 just like it was a built-in Excel function. For example, assuming your summary sheet is the first sheet so that you want to start listing from the second sheet onward, put this formula in your starter cell and then copy it down...

=GetB2(ROWS($1:2))

If you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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