LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Floating Command Button - How to???

Thanks all for your help. I'm focusing in on the commandbar object.

tt

On Wed, 31 Dec 2003 10:51:29 -0600, "Dianne"
wrote:

The best I could come up with is to put the code into the worksheet's
SelectionChange event:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim btn As OLEObject
Dim rng As Range

Set rng = Windows(1).Panes(1).VisibleRange.Cells(1, 1)
Set btn = ActiveSheet.OLEObjects("CommandButton1")

btn.Top = rng.Top + 20
btn.Left = rng.Left + 20

Set rng = Nothing
Set btn = Nothing
End Sub

This won't reposition on scrolling, but when the user clicks into the
newly visible area, the button will reappear. Kinda clunky. Also, this
doesn't work if you've frozen panes.

Your best bet might be, as Rob says, a commandbar object.


 
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
Macro for floating button Gilbert Excel Discussion (Misc queries) 8 January 25th 10 04:07 PM
floating button Jack Sons Excel Discussion (Misc queries) 6 January 7th 09 09:22 PM
Floating button pcor New Users to Excel 6 December 11th 06 03:51 AM
Floating command button Pat Excel Discussion (Misc queries) 4 April 7th 06 01:28 PM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM


All times are GMT +1. The time now is 12:32 AM.

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"