Solved

Which rows have been selected in EXCEL

Posted on 2004-08-26
4
174 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 125 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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