Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This could be a solution, although it isn't perfect by any means, but you have to be careful if you want to use data validation elsewhere in the worksheet as it will break that.</p> <p>This would need work on resetting the data validation range when you select a different range, but you should be able to determine if this approach is of any use first.</p> <p>In the selection change event</p> <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range) doSumTip End Sub </code></pre> <p>and then use data validation to set an input message on your selection. You can alter this to show counts or averages etc.</p> <pre><code>Sub doSumTip() Dim myRng As Range Dim sumTip Set myRng = Selection If myRng.Count &gt; 1 Then sumTip = WorksheetFunction.Sum(myRng) With Selection.Validation .Delete .Add Type:=xlValidateInputOnly .IgnoreBlank = True .InputMessage = sumTip End With Else With Selection.Validation .Delete .Add Type:=xlValidateInputOnly .InputMessage = "" End With End If Set myRng = Nothing End Sub </code></pre> <p>OR you could create your own tooltip with a textbox using the selection range and positioning it based on that selection, suggest the textbox be colored and flat like the data validation one</p> <pre><code>Sub doSumTip() Dim myRng As Range Dim sumTip Set myRng = Selection If myRng.Count &gt; 1 Then sumTip = WorksheetFunction.Sum(myRng) cTop = myRng.Top cWidth = myRng.Left + myRng.Width ActiveSheet.TextBox1.Left = cWidth ActiveSheet.TextBox1.Top = cTop ActiveSheet.TextBox1.Text = sumTip ActiveSheet.TextBox1.Visible = True Else ActiveSheet.TextBox1.Visible = False End If Set myRng = Nothing End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload