Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2004

Tip: Looking for answers? Try searching our database.

Reinitialize a RANGE object in VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick - 06 Apr 2004 16:08 GMT
Hi, again...now another question

I would like to write a function:
Public Function NetPV(CashFlows As Range, drate As Double, period As Integer) As Variant

All I need is the ability to change the contents of the Range array, CashFlows depending on the
period.  Is it possible to do so?

For example if CashFlows has 7 cell references in it and I just need the first 2:
CashFlows = (CashFlows(1), CashFlows(2))

I know this doesn't work as the compiler has a fit.

Any ideas?

Thank you all so much,

Rick
jaf - 06 Apr 2004 22:26 GMT
Hi Rick,
One way.
Public Function NetPV( drate As Double, period As Integer) As Variant
Dim CashFlows as range
Set CashFlows = Selected 'cells selected with mouse
Debug.print CashFlows.Address, CashFlows.rows.count,
CashFlows.rows(2).address, CashFlows.rows(2).value

Signature

John
johnf 202 at hotmail dot com

| Hi, again...now another question
|
[quoted text clipped - 14 lines]
|
| Rick
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.