PC Review


Reply
Thread Tools Rate Thread

comment or input message

 
 
Alex
Guest
Posts: n/a
 
      13th Mar 2008
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("D225")) Is Nothing Then
MsgBox ("Please enter name.")
End If

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      13th Mar 2008
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("D225")) Is Nothing Then
> MsgBox ("Please enter name.")
> End If
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula in comment or input message Little19 Microsoft Excel Misc 2 28th Sep 2009 09:21 PM
comment recevoir des message et les envoyer marianne raymond Microsoft Access 1 24th Aug 2008 09:10 PM
Scanner & Camera Wizard Comment Line Input =?Utf-8?B?V2VuZGVsbCBIYW5zb24=?= Windows XP Photos 1 9th Aug 2007 06:29 PM
Outlook:comment input option/column when email processed/filed =?Utf-8?B?Q2FtZXJvbiBPd2Vucw==?= Microsoft Outlook Discussion 0 22nd Aug 2006 10:33 AM
Add a Post-It-style comment to email message =?Utf-8?B?Y2FtX21hY2xlb2Q=?= Microsoft Outlook Discussion 0 24th Apr 2006 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 PM.