Slight Annoyance

C

cosmmarchy

Hello all,

I have a spreadsheet which creates a button when cells in column B ar
clicked. The annoyance is that when you click cells in column B, ther
is a delay where the clicked cell is highlighted, the button is delete
and then reappears next to the new cell.

Is there a way to improve this so that the button is deleted when th
old cell looses focus and reappears with the new cell?

If you click any cell in column C you'll see the difference between wha
I have and how the button appears with the data validation.

It would be nice to have the same button visibility.

Is there a way?

Thank

+-------------------------------------------------------------------
|Filename: Example.zip
|Download: http://www.excelbanter.com/attachment.php?attachmentid=649
+-------------------------------------------------------------------
 
I

isabelle

hi,

i did a test with visible = true or false and i do not see any difference,
it may be a matter performance of the video card

Code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
target As Range)

Dim ctrl As Button, isect

On Error Resume Next

Application.ScreenUpdating = False
'    Application.EnableEvents = False

Set isect = Application.Intersect(target, Range("B:B"))
Set ctrl = Sh.Buttons("test")


If Not isect Is Nothing Then
If Not ctrl Is Nothing Then
ctrl.Visible = False
ctrl.Top = target.Top
ctrl.Visible = True
Else
Set ctrl = Sh.Buttons.Add(target.Left + target.Width + 2,
target.Top, 15, target.Height)
ctrl.Top = target.Top
ctrl.OnAction = "ThisWorkbook.Clicked"
ctrl.Font.Bold = True
ctrl.Text = "..."
ctrl.Name = "test"
Set ctrl = Nothing
End If
Else
ctrl.Visible = False
End If

Application.ScreenUpdating = True
'    Application.EnableEvents = True

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top