Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hello all,
I have a spreadsheet which creates a button when cells in column B are clicked. The annoyance is that when you click cells in column B, there is a delay where the clicked cell is highlighted, the button is deleted and then reappears next to the new cell. Is there a way to improve this so that the button is deleted when the old cell looses focus and reappears with the new cell? If you click any cell in column C you'll see the difference between what 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? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- isabelle Le 2012-10-31 10:13, cosmmarchy a écrit : Hello all, I have a spreadsheet which creates a button when cells in column B are clicked. The annoyance is that when you click cells in column B, there is a delay where the clicked cell is highlighted, the button is deleted and then reappears next to the new cell. Is there a way to improve this so that the button is deleted when the old cell looses focus and reappears with the new cell? If you click any cell in column C you'll see the difference between what 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? Thanks +-------------------------------------------------------------------+ |Filename: Example.zip | |Download: http://www.excelbanter.com/attachment.php?attachmentid=649| +-------------------------------------------------------------------+ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
petty annoyance | New Users to Excel | |||
Slight "save" annoyance | Excel Discussion (Misc queries) | |||
Reviewing toolbar annoyance | Excel Discussion (Misc queries) | |||
Silly little annoyance | Setting up and Configuration of Excel | |||
Excel annoyance | Excel Discussion (Misc queries) |