Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Which rows have been selected in EXCEL

Posted on 2004-08-26
4
Medium Priority
?
178 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

886 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