Custom Range Method

  • Thread starter Matthew Pfluger
  • Start date
M

Matthew Pfluger

I would like to write a custom method for the Range object that returns a
Range object representing all child rows of the called row. I looked in the
Object Browser, and I don't think such a method exists, but if somoeone knows
differently, please tell me!

The routine may be called like this:

Dim rng as range
set rng = Rows(1).ChildRows.Select

Is it possible to write a custom method for an existing object, or do I have
to write a similar class module (i.e. CRange) and then write the method?

Thanks,
Matthew Pfluger
 
D

David

Hi,

I am in the cell that has a formula, then,
Sub Macro1()
Selection.ShowPrecedents
Range(ActiveCell.Address).Precedents.Select
z = Selection.Address
MsgBox z
End Sub

Hope this helps.
David
 
M

Matthew Pfluger

David,

I appreciate that, but I was referring to the Outline property. I apologize
for not making that clear. Excel provides the handy ability to group rows,
but they don't expose a lot of methods or properties for using this
functionality.

Thanks,
Matthew Pfluger
 
D

David

Hi,

These are simple SubTotals or part of a pivot table? If it is SubTotals, I
think you can still use what was already provided, but if it is a pivot
table, then not.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top