1

I am wondering if there is an equivalent to the indirect function for worksheets or workbooks instead of cells. What I mean by that is I am updating a rather large and unwieldy workbook for payroll for a company that has all sorts of people at different hourly rates working on different projects. Each employee submits their payroll info for the month as an excel worksheet. What I want to do is automate the aggregation of each employees hours for each particular project as much as possible. If I could call a particular cell in a particular workbook without changing the formula every time that'd be great.

To put it another way, every month each employee submits their worksheet titled "Name Month". I want to compile these in a workbook and automatically pull the data for a summary page that will list the bills for different projects. I think I could do this if the indirect function could also be used for worksheets instead of just cells, but it can't. Is their an equivalent function?

I do not know VBA.

Thanks

3
  • 1
    Indirect will work for that, assuming all the workbooks are open. Commented Feb 26, 2014 at 2:30
  • One of the things I'd like to do is change the name and the month in the master sheet and have it point to the corresponding work sheet. So if I have a worksheet titled "Bob January" and I want to return cell F1 from that worksheet, how would I do it? A1 = Bob B1 = January C1 = A1&" "&B1 D1 = Indirect("C1&!"F1) This is what I was thinking, but I keep getting #REF. Commented Feb 27, 2014 at 14:45
  • To reference a worksheet with a space you need to surround it in single quotes. D1 =INDIRECT("'" & A1 & " " & B1 & "'")` of course you need to complete it with a !A1 or whatever cell to actually reference. Commented Feb 27, 2014 at 15:19

1 Answer 1

1

For:

A1 = Workbook

A2 = Worksheet

A3 = Cell Reference

Use =INDIRECT("[" & A1 & ".xls" & "]" & A2 & "!" & A3)

To reference a worksheet with a space you need to surround it in single quotes ('). For:

A1 = Workbook

A2 = Worksheet Name 1

A3 = Worksheet Name 2

A4 = Cell Reference

Use =INDIRECT("[" & A1 & ".xls" & "]" & "'" & A2 & " " & A3 & "'" & "!" & A4)

To reference a particular range in the sheet that you do not have recorded in a cell, simply place it alongside the !:

Use =INDIRECT("[" & A1 & ".xls" & "]" & "'" & A2 & " " & A3 & "'" & "!E34")

Note: With INDIRECT, you must reference only open workbooks

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .