Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse over

Status
Not open for further replies.

Trainingjason

Instructor
Dec 6, 2001
127
GB
Hi

I am using the auditing toolbar, and to check multiple cells is painful. I would like to move the mouse over a cell and attached to the cursor is a comment box with trace dependents shown within it.

Does any one have the code to do this. I am trying to track down errors and have have thousands of lines lines of data, over numerous sheets.

Any help greatfully appreciated.

J
 



Hi,

There are no mouse events on the spreadsheet

I need a clarification, reagarding, "...have have thousands of lines lines of data..."

But aren't all formulas in one column identical: copied from one row to all rows?

So does the number of rows really add to the number of formulas to evaluate?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
It is a little more complex, I have 5 separate projects, each with a cost model, I need to combine the cost models in various different ways for a reporting perspective.
I am getting errors and are struggling to work out why.
Hence I need to go to item in the cost model and trace where it goes to. It is used in mulitple sheets for different reasons, and then all sheets are crossed reference.
Hence having the goto a different sheet data on the auditing toolbar being displayed either in a comment on the sheet or on the mouse as I move over a cell in the cost model will help.

I am trying to compare cost models, cost models breakdown to actuals and this feature would save a lot of time in the design.

J
 
The following code may help. It displays the contents of a cell in a comment box when selected.

Code:
'centres comment in middle of screen
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

  
 bEqual = False
 sAuthor = Application.UserName
 sCR = Chr(10)
 sCR2 = sCR & sCR
 sDate = Format(Date, "yyyy.mm.dd")
 sTime = Format(Time, "hh:mm")
 sFormula = ActiveCell.Formula

 
 On Error GoTo nocomment
 If Not ActiveCell.Comment.Text = "" Then Exit Sub

 
nocomment:
 With ActiveCell

   .AddComment
   .Comment.Text Text:=sAuthor & sCR & sDate & _
     "  " & sTime & sCR2 & sFormula
   .Comment.Visible = False
   With .Comment
    .Shape.TextFrame.Characters.Font.Size = 12
    .Shape.ScaleHeight 2.26, msoFalse, msoScaleFromTopLeft
    .Shape.ScaleWidth 3.87, msoFalse, msoScaleFromTopLeft
    End With
 End With

 
 Application.DisplayCommentIndicator _
    = xlCommentIndicatorOnly
 
 Set rng = ActiveWindow.VisibleRange
 cTop = rng.Top + rng.Height / 2
 cWidth = rng.Left + rng.Width / 2
If ActiveCell.Comment Is Nothing Then
  'do nothing
Else
  Set cmt = ActiveCell.Comment
  Set sh = cmt.Shape
  sh.Top = cTop - sh.Height / 2
  sh.Left = cWidth - sh.Width / 2
  cmt.Visible = True
End If

End Sub
 
In [link thread707-1205557 you can find an api procedure that, using timer, picks range under cursor.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top