How do i use the same cell name accross multiple tab names in a wo

P

Paul

I am to create a main worksheet as "accounts"
I have 40 "client" tabs (all the same)

i wish to list the same cell ref across all 40 sheets into a verticle listing

eg

"accounts" sheet cell b1 would have "client1" cell a3
"accounts" sheet cell b2 would have "client2" cell a3

i have listed "client1" name in accounts sheet cell a1, and client2 in a2 etc.
 
J

Jarek Kujawa

Sub d()

For Each ws In ActiveWorkbook.Worksheets
counter = counter + 1
Cells(counter, 2).Formula = "=" & ws.Name & "!A3"
Next ws

End Sub

press ALT+F11, Insert->Module, copypaste this code
then click Run, Run Sub
 
P

Paul

Thanks Roy, but i am not used to pivottables.

must be an easy way to copy and paste and pick up "client1" tab, and client2
tab etc
 
P

Pete_UK

Put this formula in B1 of accounts sheet:

=INDIRECT("'"&A1&"'!A3")

then copy down to B40.

Hope this helps.

Pete
 
P

Paul

I WORKED IT OUT

=INDIRECT($A2&"!$B$4")

note cell A2 has the tab names in it, and B4 has the data from that tab.
 
P

Pete_UK

Note that as the reference to B4 is in quotes, and therefore treated
as text, you do not need the $ symbols as it will not change when you
copy it to other cells.

Also, your cell references differ from what you first posted.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top