Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 4
Default Slight Annoyance

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
Attached Files
File Type: zip Example.zip (18.9 KB, 44 views)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Slight Annoyance

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
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
petty annoyance Ralphael1 New Users to Excel 25 July 26th 05 02:28 PM
Slight "save" annoyance marcy Excel Discussion (Misc queries) 3 April 13th 05 01:15 PM
Reviewing toolbar annoyance Steve Excel Discussion (Misc queries) 1 January 13th 05 09:57 PM
Silly little annoyance Setting up and Configuration of Excel 6 December 22nd 04 09:33 PM
Excel annoyance thethinker Excel Discussion (Misc queries) 3 November 30th 04 10:44 PM


All times are GMT +1. The time now is 04:45 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"