Which rows have been selected in EXCEL

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
zomby_dogAsked:
Who is Participating?
 
RejojohnyConnect With a Mentor Commented:
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
 
RejojohnyCommented:
"selection" object gives a range of the selected cells

0
 
RejojohnyCommented:
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
 
zomby_dogAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.