Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text message using data validation.
Ok here is what I am doing. I have created a text box that will only display
when certain cells are selected. (Example: Instructions for what to enter in that cell). Also depending on what cell is selected the message will be different. I created a text box and used the following code Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim strTitle As String Dim strMsg As String Dim sTemp As Shape Dim ws As Worksheet Application.EnableEvents = False Set ws = ActiveSheet Set sTemp = ws.Shapes("txtInputMsg") On Error GoTo errHandler If Intersect(Target, ws.Cells.SpecialCells(xlCellTypeAllValidation)) Is Nothing Then sTemp.TextFrame.Characters.Text = "" sTemp.Visible = msoFalse Else If Target.Validation.InputTitle < "" Or _ Target.Validation.InputMessage < "" Then strTitle = Target.Validation.InputTitle & Chr(10) strMsg = Target.Validation.InputMessage With sTemp.TextFrame .Characters.Text = strTitle & strMsg .Characters.Font.Bold = False .Characters(1, Len(strTitle)).Font.Bold = True End With sTemp.Visible = msoTrue Else sTemp.TextFrame.Characters.Text = "" sTemp.Visible = msoFalse End If End If errHandler: Application.EnableEvents = True Exit Sub End Sub This works great other than if I lock the sheet the message will not change when I select a different cell. I have unlocked the cells that the messages are to populae for, and unloked the text box. Is there a way to lock the sheet and still have the message change according to the cell that is selected? I hope this all makes sense. Can anyone help me with this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
32,000 data points error message | Charts and Charting in Excel | |||
Data Validation Input Message | Excel Worksheet Functions | |||
How change dimensions of data label text box in pie chart? | Charts and Charting in Excel | |||
Problem organizing text data into new excel page | Excel Worksheet Functions | |||
Data validation, cell protection or other method? | Excel Discussion (Misc queries) |