Solved

Which rows have been selected in EXCEL

Posted on 2004-08-26
4
170 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now