index > Visual Studio Tools for Office > Determine selected cells in a ListObject

Determine selected cells in a ListObject

Can someone tell me how to determine which cells in the ListObject are currently selected? I don't see a property or anything in the ListObject to get the selected range.

Thanks in advance.

Julie2

Hi Julie,

I'm not sure if it is the proper way, but I would get the selected range the following way:


Dim ExcRng As Excel.Range

' This part checks if the application's selected range is inside the list's data range.
ExcRng = Globals.ThisWorkbook.Application.Intersect(Globals.ThisWorkbook.Application.ActiveCell, Globals.Sheet1.ListObject.DataBodyRange)

' If the selected range is inside the list, use it!
If Not (ExcRng Is Nothing) Then
ExcRng = Globals.ThisWorkbook.Application.ActiveCell
' Now you can use ExcRng as it holds the selected range!

End If


Please see if it works! ;)




Darsel Engineering
Daniel Rodriguez
reply 2

You can use google to search for other answers

 

More Articles

• Publish to SharePoint?
• Microsoft Office 2003 Save My Settings Wizard
• Word: How to skip few events' instances
• How can I standardize SIGNATURES in OUTLOOK for all the employees...
• Runtime Pure virtual function call R6025
• ServerDocument - Security exception
• Populating a Word Document
• Problems SmartDocument 1.1 in new Office B2TR
• Visual Studio Packaging utility problem
• Assembilies for VSTO files
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Binding Keys
• where is Access runtime
• Custom font colors
• Error with vsto
• Shared Add-In VS2005
• Intercept events from custom controls
• SELECT Statement against Excel file?
• VSTO Deployment
• Opening a page in a content place holder
• My Pet Peeve of the day
• ListObject bug or something silly?
• vsto code
• VSTO 2003 basics
• Task Pane controls
• Visual Studio For Applications IDE Hunt

Hot Articles

• Save Excel Data to Sql Server Database
• ListObject bug or something silly?
• Databinding CheckedListBox .Net 2005
• saving a range?
• Still in need for help...
• Shutdown word application forcefully
• VSTO 2005 Samples
• Made a mistake...unable to uninstall!
• Paste can invalidate schema
• Rename print job from Excel
• Outlook Deployment ala ClickOnce
• Deploying VSTO Word Project: could not f
• Caching with app add-ins
• How could i develop Office Add-ins compa
• Import xml

Recommend Articles

• Network write access problem?
• VSTO 2005 SE Outlook Form Regions, CTP a
• PIA - Set layout of word document for op
• Deployment prerequisites question
• Before I go out and buy VSTO...
• launching a VSTO app within a whidbey wi
• Setting the style of the current XMmlNod
• Create a "Bare" Workbook From
• Need help for Excel App.
• Context-sensitive Actions pane: Odd upda
• InfoPath - WebService - BizTalk
• programmatical adding xml schema to sche
• How to count no of non space characters
• Treeview webpart in sharepoint portal se
• Programmatically Changing Manifest locat