LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default listbox scrolling with mouse

I have a listbox in excel 2002 that is loaded with the names of all the
sheets in the workbook to allow the user tp navigate quickly from sheet to
sheet. Dragging the mouse over each entry in the listbox works well. The
code to activate each sheet is in the Click event for the listbox.

Problem: when I added code to the listbox click event to preserve the
selected cells area of the first listbox, the list box no longer reliably
responds to dragging the mouse over it.

The Code:

Private Sub lstFreeRooms_Click()

' show the sheet clicked on and
' preserve the current selection

Dim currentSelectionAddress As String

currentSelectionAddress = Selection.Address

' activate the sheet selected in the listbox

Dim sheetname As String

sheetname = Me.lstFreeRooms.Value
Sheets(sheetname).Activate

' restore the current selection
ActiveSheet.Range(currentSelectionAddress).Select

End Sub

-------------------------------------------------

I have tried many work arounds. The only one that is somewhat satisfactory
is to put the code to preserve the current selection into the mouse down and
mouse up events.

Thanks for any assistance.


 
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
F2 stops mouse scrolling Annette Excel Discussion (Misc queries) 4 March 12th 08 08:01 AM
Scrolling with Mouse [email protected] Excel Worksheet Functions 3 August 9th 07 07:16 PM
How to get a listbox to move when scrolling down spreadsheet kdunnSBLI Excel Discussion (Misc queries) 1 June 24th 05 12:31 AM
Want listbox to move when scrolling down spreadsheet kdunnSBLI Excel Discussion (Misc queries) 3 June 23rd 05 11:11 PM
Scrolling with Mouse PC_Joe Excel Discussion (Misc queries) 2 May 19th 05 07:22 PM


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