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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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