LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Mouseover or Mouse Move events

I want to 'remind' users, including myself, not to edit
particular cells on Sheet1 and do this on Sheet2
instead. I did not want to use Protect and UnProtect
measures. The code below creates a Comment and changes
the cell font colour if an 'alert' cell is selected.
These changes are then reversed when the user makes
another selection. So I have achieved the objective of
providing a reminder. BUT, is it the best user interface?

I think that a long way back I saw some code using a
mouse move or mouse over event which changed the colour
of cells as it tracked. This would deliver a
similar 'message' but would be quite cool to do. Can
this be done?

Appreciate any help

Geoff

Code for Comment and colour change, aplogies for th
tabbing:
Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

'Because comments cannot be inserted on multiple
selections the procedure ignores multiple selections
selcount = 0
For Each p In Selection
selcount = selcount + 1
If selcount 1 Then Exit Sub
Next

'Set alert targets as a range
Set dontchangethishere = Union( *** alert cell addresses
****)

Select Case Target.Column
Case 2 'Within column B
Select Case Target.Row 'Within target rows
Case ***** Rownumbers of alert cells***
If Target.Comment Is Nothing Then
Range(Target.Address).AddComment "To edit
please go to sheet 2"
With Range(Target.Address).Comment.Shape.TextFrame
.Characters.Font.Name = "Comic Sans MS"
.Characters.Font.FontStyle = "Bold"
.Characters.Font.Size = 10
.AutoSize = True
End With
Range(Target.Address).Font.Color = vbRed
Else
Range(Target.Address).Comment.Delete
Range(Target.Address).Font.ColorIndex =
xlColorIndexAutomatic
End If
Case Else ''Not in target rows
For Each c In dontchangethishere
If Not c.Comment Is Nothing Then
c.Comment.Delete
c.Font.ColorIndex = xlColorIndexAutomatic
End If
Next
End Select
Case Else ''Not in column B
For Each c In dontchangethishere
If Not c.Comment Is Nothing Then
c.Comment.Delete
c.Font.ColorIndex = xlColorIndexAutomatic
End If
Next
End Select

End Sub
 
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
How to move a row using mouse but not overwrite other row? Oneswolf Excel Discussion (Misc queries) 2 April 13th 06 08:12 PM
Any mouse events for Worksheets? InExcelHell Excel Programming 0 January 10th 05 11:17 PM
mouse click or mouseover and get color sakijung[_3_] Excel Programming 2 November 22nd 04 10:50 AM
How to use mouse events inside an Excel Sheet ? mike Excel Programming 7 July 28th 04 12:23 PM
Mouse over events for Active X objects in excel Shrinu Excel Programming 1 May 26th 04 10:42 PM


All times are GMT +1. The time now is 11:35 PM.

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

About Us

"It's about Microsoft Excel"