Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Custom Range Method

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Custom Range Method

Correction, I should have said CUSTOM RANGE PROPERTY, not method.

"Matthew Pfluger" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Custom Range Method

Hi Matthew,

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?


You have to write your own class module indeed.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Custom Range Method

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

"Matthew Pfluger" wrote:

Correction, I should have said CUSTOM RANGE PROPERTY, not method.

"Matthew Pfluger" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Custom Range Method

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

"David" wrote:

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

"Matthew Pfluger" wrote:

Correction, I should have said CUSTOM RANGE PROPERTY, not method.

"Matthew Pfluger" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Custom Range Method

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

"Matthew Pfluger" wrote:

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

"David" wrote:

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

"Matthew Pfluger" wrote:

Correction, I should have said CUSTOM RANGE PROPERTY, not method.

"Matthew Pfluger" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA ErrorBar method does not allow custom minusvalues Alex Excel Programming 0 August 8th 08 10:41 AM
"PasteSpecial method of Range class failed" when range Number of Rows 2000 eskimo2 Excel Programming 0 October 19th 07 06:09 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Specify which method is default in custom class Bing Excel Programming 1 December 23rd 04 10:33 PM
Adding named range gives error "method range of object _Global failed " Gunnar Johansson Excel Programming 3 August 10th 04 01:54 PM


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"