Need to know if you can use a cell value as a sheet name in an IF statement

Grant22

New Member
Joined
Dec 28, 2016
Messages
48
Hello all, I am trying to write a quick if statement to reference a sheet by the same name in my workbook. So I already have a sub that fills column A with all the sheet names in my workbook, I was wondering if I could then use that Cell value to reference the sheet I want to pull info from. Here's the formula I'm getting an error on:

=IF(ISBLANK(A11),0,SHEETS("A11")!S15)
In this example, Cell A11 has the name "Sample" in it which is also the name of the sheet I want to pull info from.

The statement below works but it hard codes the name Sample as the sheet name, if I can pull it from a cell I can then just drag it across and down to make things faster.

=IF(ISBLANK(A11),0,Sample!S15)

Anyone know a way to use the cell value as reference?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,214,661
Messages
6,120,793
Members
448,994
Latest member
rohitsomani

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