View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Oscar Oscar is offline
external usenet poster
 
Posts: 35
Default Selection method not available in VB when referencing Excel worksheet

John,

yes, that's the case. I am able to reference the selection in this way, but
I can't adress any members such as .row or .rows inside the 'selection'
method, The VB IDE doesn't show them and in case I write

oxlWkb.Application.Selection.Row or
oxlWkb.Application.Selection.Rows or
oxlWkb.Application.Selection.Range

the compiler fires an error in runtime. Could you please explain what I need
to do after the oxlWkb.Application.Selection statement in order to find out
the row numbers of the toprow and bottomrow.
regards,
Oscar




"John Green" schreef in bericht
...
Oscar,

Are you saying that you are writing code in VB (not VBA) and that you have

an object variable referring to an active Excel workbook
(say oxlWkb)? If so, one way to refer to the current selection is:

oxlWkb.Application.Selection

--

John Green - Excel MVP
Sydney
Australia


"Oscar" wrote in message

.nl...
In a VB application, I am referencing an Excel workbook. I need to know

the
row number of the toprow and bottomrow of any range selection. Therefore

I
want to use the selection object. However, the 'selection' object is not
available for the Excel.worksheet method and is only available for the
Excel.application and it doesn't show any method after selection. For
example I can't use selection.rows. How can I change this ?

Oscar