Need to create a conditional incell comment...

Jeffrey Green

Well-known Member
Joined
Oct 24, 2007
Messages
1,021
I have a spreadsheet with a column of pull down cells. Using INDIRECT, each cell's menu options are unique, based on the answer is in the cell above.
Each individual response gets looked up in a table and a code isretrieved for that answer.
In one particular situation, if the answer chosen in Cell B12 retrieves a code of "S", i need to ask a lengthy question in Cell B13. I can put it in an In-Cell comment, but i only want to appear if the previous cells repsonse code as "s" . . . . maybe have a modeless window open if the response code is s?????

thanks
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You could possibly use the worksheet_Change event to do what you are asking. In your particular situation, the following code might get you pointed in the right direction:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B12").Value = "S" And Range("B13") = "" Then
  Range("B13").Activate
  MsgBox ("Lengthy Question") ' or you could use:  UserForm1.Show
End If
End Sub

Take care.

Owen
 
Upvote 0
.. or maybe use the Worksheet_SelectionChange event:

<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_SelectionChange(<SPAN style="color:#00007F">ByVal</SPAN> Target <SPAN style="color:#00007F">As</SPAN> Range)<br>    <SPAN style="color:#00007F">If</SPAN> Target.Address = "$B$13" And Range("B12").Value = "S" <SPAN style="color:#00007F">Then</SPAN><br>        MsgBox "Long message"<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

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