Excel Noob with question on referencing worksheet names

sloojer

New Member
Joined
Jan 27, 2005
Messages
5
Hello

I am trying to dynamically size a table in my "Summary" sheet with the number of "WPO" sheets in my workbook.

The WPO sheets have names of the form "WPO 1".... "WPO 100"..etc. For each WPO sheet I would like to insert a row in my summary sheet containing formulae that reference the different WPO sheets.

Here's a snippet of what I have at the moment

ActiveCell.FormulaR1C1 = = "='WPO 2'!R64C3" 'Column E

What I would like to have is a variable in the place of 'WPO 2' that I could set to any worksheet. :unsure:
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
you would wrap your code in a FOR loop

if you know th enumber then

FOR a=1 to 100
ActiveCell.FormulaR1C1 = = "='WPO " & a & "' !R64C3" 'Column E
NEXT

If you do not know th enumber of sheets then

FOR EACH a in activeworkbook.worksheets
ActiveCell.FormulaR1C1 = = "='" & a.Name & "' !R64C3" 'Column E
NEXT
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,185
Members
448,554
Latest member
Gleisner2

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