Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Recurring revenue and cost

I am trying to write a function that can be placed into a cell, but have it generate a recurring revenue or cost stream in other rows and columns. The function should look like:

BusinessModel(curRevenuePerMonth, curCost, intNumberMonths)

The function should place the curRevenuePerMonth value into a row a specific number of rows away but in the same column for intNumberMonths rows. curCost should be placed in a different row in the sheet only once in a cell a specific number of rows away (different than revenue) but in the same column as the function.

I tried the following code, but I keep getting value errors in the cell with the formula:

Function BusinessModel(RevenuePerMonth As Currency, Cost As Currency, NumberMonths As Integer)
Dim SheetRange As Range
Dim wks As Worksheet
Dim ThisCell As Range
Dim TotalRange As Range
Dim FirstColumn As Integer
Dim intI As Integer
Dim intR As Integer
Dim intC As Integer
intR=-54
intC=-34
Set wks = Worksheets("ThisWorksheet")
ActiveCell.Offset(0, 0).Select
With wks
For intI = 0 To NumberMonths - 1
ActiveCell.Offset(1, intI+intr) = RevenuePerMonth
ActiveCell.Offset(2, intI+intc) = Cost
Next
End With
End Function

Any ideas?

Harley
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Recurring revenue and cost

Harley,
A worksheet function cannot change its environment i.e. values in other
cells. It can only return a value to that cell. So this will not work.

NickHK

"Harley" wrote in message
...
I am trying to write a function that can be placed into a cell, but have it
generate a recurring revenue or cost stream in other rows and columns. The
function should look like:

BusinessModel(curRevenuePerMonth, curCost, intNumberMonths)

The function should place the curRevenuePerMonth value into a row a specific
number of rows away but in the same column for intNumberMonths rows.
curCost should be placed in a different row in the sheet only once in a cell
a specific number of rows away (different than revenue) but in the same
column as the function.

I tried the following code, but I keep getting value errors in the cell with
the formula:

Function BusinessModel(RevenuePerMonth As Currency, Cost As Currency,
NumberMonths As Integer)
Dim SheetRange As Range
Dim wks As Worksheet
Dim ThisCell As Range
Dim TotalRange As Range
Dim FirstColumn As Integer
Dim intI As Integer
Dim intR As Integer
Dim intC As Integer
intR=-54
intC=-34
Set wks = Worksheets("ThisWorksheet")
ActiveCell.Offset(0, 0).Select
With wks
For intI = 0 To NumberMonths - 1
ActiveCell.Offset(1, intI+intr) = RevenuePerMonth
ActiveCell.Offset(2, intI+intc) = Cost
Next
End With
End Function

Any ideas?

Harley


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
Creating a total cost chart where a component cost is a step cost gvm Charts and Charting in Excel 0 April 28th 10 02:10 PM
cost revenue relationship Karan Walia Charts and Charting in Excel 1 April 25th 06 05:14 PM
Current Cost versus Original Cost A Boe New Users to Excel 2 August 19th 05 02:19 AM
Confusion on adding percentage of cost to that cost. [email protected] Excel Worksheet Functions 12 July 13th 05 11:45 PM
HELP! monthly recurring revenue DigtalMe Excel Worksheet Functions 0 November 23rd 04 08:27 PM


All times are GMT +1. The time now is 12:50 PM.

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

About Us

"It's about Microsoft Excel"