anonymouse
anonymouse

Reputation: 639

Convert string to cell reference that can be passed to function

I'm trying to figure out how to generate a cell reference to pass to a function. I have a cell that looks like this:

=INDIRECT(sheetName() + "!B5:F5")

where sheetName is a custom function. I get this error: Error Function ADD parameter 1 expects number values. But 'October' is a text and cannot be coerced to a number. Where "sheetName()" returns "October". What on earth am I doing wrong?

Upvotes: 3

Views: 1758

Answers (1)

Tom
Tom

Reputation: 1320

Try using the '&' instead of '+'. That has worked for me when using indirect.

Upvotes: 3

Related Questions