Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Which rows have been selected in EXCEL

Posted on 2004-08-26
4
Medium Priority
?
176 Views
Last Modified: 2012-05-05
Hi,

I am acessing an excel application through VB, and I was wondering if anyone knew how to return a list of all the rows selected?

Cheers,
Dan
0
Comment
Question by:zomby_dog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 26

Expert Comment

by:Rejojohny
ID: 11901845
"selection" object gives a range of the selected cells

0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 11901868
the sheet from where u want to fetch the selected cells have to be active ...
then use the selection object

try this in ur code

msgbox selection.address
0
 

Author Comment

by:zomby_dog
ID: 11902348
I don't seem to have the selection object. I create an worksheet variable (Dim mWorksheet as excel.worksheet) and the try and access the selection object and it doesn't seem to exist.

I'm doing this from VB6 not VBA by the way.

Cheers,
Dan
0
 
LVL 26

Accepted Solution

by:
Rejojohny earned 500 total points
ID: 11902447
ok .. what is ur excel application  object name ..
dim lobjExcel as new excel.application  '.... something like that .. =right?

so
msgbox lobjExcel.Selection.Address

.. it will give u the address of the selected cells of the active sheet of the active workbook
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question