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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
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,215,373
Messages
6,124,559
Members
449,171
Latest member
jominadeo

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