View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter van de Kerkhof Peter van de Kerkhof is offline
external usenet poster
 
Posts: 9
Default How to get the 'current row' from VBA

Works like a charm

Thanks Peter

"Dave Peterson" schreef in bericht
...
Something like this within the common macro:

Option Explicit
Sub myCommonMacro()

Dim myShape As Shape

Set myShape = ActiveSheet.Shapes(Application.Caller)

MsgBox myShape.TopLeftCell.Address & vbLf & _
myShape.BottomRightCell.Address

End Sub


myshape.topleftcell.row might be what you want.


Peter van de Kerkhof wrote:

I.'m sorry Leo but that didn't help me much.

Yes I've found the TopLeftCell/BottomRightCell property but don't know

how
to apply it.

Can you give a sample like:

sub Updateline()
summarybook = Excel.ThisWorkbook.Name
MsgBox Workbooks(summarybook).Worksheets(DevList).TopLeft Cell
end sub

regards Peter

"Leo Heuser" schreef in bericht
...
Hi Peter

Check out the TopLeftCell/BottomRightCell property.

--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"Peter van de Kerkhof" skrev i en meddelelse
.. .
Hi,

I want to execute a macro and let it read/store some values in de

current
row.

My intention was to place a graphical object in a row, attach the

macro
to
it
and let the macro 'dectect the "current row'' and read/store

values
row
related.
And do this for several rows, that all execute the same macro.

How to solve this or are there smarter solutions!
(I want to execute this for any single row)


Regards Peter





--

Dave Peterson