Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
comment or input message
I need to show a comment or data validation input message when a user clicks
in a cell. Comments won't work because we don't want the indicator to show. Data validation won't work because it won't allow me to publish a List (Excel 2003) to a SharePoint server when data validation is present. So, I'm using the below code. However, I don't want an actual message box to appear that a user must click OK to close. Is there a way, in code, to show a cell comment momentarily when a cell is selected? Thanks. If Not Intersect(Target, Range("D2:D25")) Is Nothing Then MsgBox ("Please enter name.") End If |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
comment or input message
Very easy:
First enter these two sub to create and destroy a message in a simple textbox: Sub create_message() ActiveSheet.Shapes.AddShape(msoShapeRectangle, 263.25, 61.5, 134.25, 61.5). _ Select Selection.Characters.Text = "Hello world" With Selection.Characters(Start:=1, Length:=11).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With End Sub Sub destroy_message() On Error GoTo exxit ActiveSheet.Shapes(1).Select Selection.Cut exxit: End Sub Then put this event code in the worksheet code area: Private Sub Worksheet_SelectionChange(ByVal Target As Range) ' ' gsnuxx ' Set t = Target Set b9 = Range("B9") If Intersect(t, b9) Is Nothing Then Call destroy_message Exit Sub Else Call create_message b9.Select End If End Sub -- Gary''s Student - gsnu200773 "Alex" wrote: I need to show a comment or data validation input message when a user clicks in a cell. Comments won't work because we don't want the indicator to show. Data validation won't work because it won't allow me to publish a List (Excel 2003) to a SharePoint server when data validation is present. So, I'm using the below code. However, I don't want an actual message box to appear that a user must click OK to close. Is there a way, in code, to show a cell comment momentarily when a cell is selected? Thanks. If Not Intersect(Target, Range("D2:D25")) Is Nothing Then MsgBox ("Please enter name.") End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula in comment or input message | Excel Discussion (Misc queries) | |||
Message Box - With Text Input | Excel Programming | |||
Message or input | Excel Discussion (Misc queries) | |||
Input Box and Message box Help | Excel Programming | |||
input message | Excel Programming |