Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula in comment or input message Little19 Excel Discussion (Misc queries) 2 September 28th 09 09:21 PM
Message Box - With Text Input Nick Hodge Excel Programming 2 December 8th 06 12:59 PM
Message or input thesaxonuk Excel Discussion (Misc queries) 4 October 25th 06 09:38 AM
Input Box and Message box Help Lost and Looking for Help Excel Programming 3 June 14th 06 06:13 PM
input message tamersaid Excel Programming 1 June 6th 04 02:06 PM


All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"