Check value in other sheet, sheetname entered in cell

miicker

Board Regular
Joined
Jun 1, 2014
Messages
75
I am using a sheet where a user can enter (pick from drop down list) the name of the sheet, then data is gathered from that sheet using indirect formulas.
This all works great, but there is one type of sheet I don't wan't to allow.

The user enters the sheet name in cell D6. I have a built in parameter in the entered sheet in cell Q2. When that parameter is filled with for example the text "yes", than the user should get a msgbox telling the user that the entered sheet cannot be used, and the cell D6 should stay empty.

So I would like to build some code that checks the following:
Code:
IF *name of the sheet entered in cell D6*!Q2 = yes THEN
MsgBox ("The sheet u entered cannot be used")
Range("D6").Value = ""
End If

I cannot figure out how what code to use for the part between **.

Thanks in advance!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
because it was already a pain in the *** to get it working like it's working now. The sheet names are also changing, and I already exclude some sheet names.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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