incrementing worksheet names dynamically

dmstarr

New Member
Joined
Apr 9, 2002
Messages
2
have numbered tabs for worksheet names in my workbook and have created a summary sheet that computes from each sheet. Cannot get the @#$@$ formula to let me mathematically change the sheet name tho. Would like to copy and paste one row of formulas for all 50 rows of the summary.

eg:
COUNTIF('8'!$G$3:$G$143, "gary")

would count the occurrences in sheet 8.
I'd _like_ to have it be
COUNTIF('prevrowval+1'!$G$3:$G$143, "gary")

where prevrowval starts as 0 (a constant), and the first actual row of the table ends up with the value of 0+1 in the formula, corresponding to sheet named 1 in my workbbook.

Stupid question I know but I can't figure it out without having to program in VB and I _really_ think there's an easier way.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
If you are starting in row 2 of your summary sheet:

=COUNTIF(indirect(row()-1) & "!$G$3:$G$143", "gary")
 
Upvote 0
Thanks for previous post, but Excel 2000 seems to find it has an error. Can u explain functional syntax so I can debug it?

is row() a tricky way to use the row number as a sheet name?
 
Upvote 0
I don't think you can do it without VBA, sorry.

For i = 1 To ThisWorkbook.Worksheets.Count
Cells(i, 1).Formula = "=COUNTIF(" & i & "!G3:G143,""gary"")"
Next i
_________________
Hope this helps.
Kind regards, Al.
This message was edited by Al Chara on 2002-04-11 11:54
 
Upvote 0
Ok, I got it to work, try the following setup:

Cell A1: =COUNTIF(INDIRECT(B1),"gary")
Cell B1: ="'"&ROW() & "'" & "!G3:G143"

Then copy the two cells down as far as you want. Is this what you want?
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
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