Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default For Each Next returns "Empty" when Data in Cell

I have written a function with the intention of iterating the function
(rather than the workbook) but am having difficulty pulling the information
through:

Public Function Iterative_LIBOR(Target As Double, Frequent As Double,
Periods_Range As Range, Swaps_Range As Range, Nominals_Range As Range,
LIBORs_Range As Range)

Cycle = 1
Freq = Frequent
DCF = 0

'Build the Discount, Period, LIBOR and Nominal Arrays

Dim Period_Array(1 To 100) As Variant

For Each ActualCell In Periods_Range.Cells

If ActualCell.Value 0.001 Then

Period_Array(Cycle) = ActualCell.Value

Else
End If

Cycle = 1 + Cycle

Next ActualCell

Although the Range Periods_Range is populated with data the "Watch" gives
each value as "Empty". Can any one help?

Thank you
--
Matt Roberts
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default For Each Next returns "Empty" when Data in Cell

I don't see anything technically wrong with your code if that is what you
want.

If you have a cell in Periods_Range that is greater than .001, then you
should have a value in your array.

You will have empty elements in the array corresponding to any cell that is
less than or equal to .001 or for any elements that exceed the number of
cells in Periods_Range up to the 100th element.

--
Regards,
Tom Ogilvy


"Matt Roberts" wrote in message
...
I have written a function with the intention of iterating the function
(rather than the workbook) but am having difficulty pulling the

information
through:

Public Function Iterative_LIBOR(Target As Double, Frequent As Double,
Periods_Range As Range, Swaps_Range As Range, Nominals_Range As Range,
LIBORs_Range As Range)

Cycle = 1
Freq = Frequent
DCF = 0

'Build the Discount, Period, LIBOR and Nominal Arrays

Dim Period_Array(1 To 100) As Variant

For Each ActualCell In Periods_Range.Cells

If ActualCell.Value 0.001 Then

Period_Array(Cycle) = ActualCell.Value

Else
End If

Cycle = 1 + Cycle

Next ActualCell

Although the Range Periods_Range is populated with data the "Watch" gives
each value as "Empty". Can any one help?

Thank you
--
Matt Roberts



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default For Each Next returns "Empty" when Data in Cell

Tom

Thank you - your interpretation was quite correct. I had hoped (for perhaps
the first time) that I had overlooked something solvable, instead I am going
to have to find another way of acheiving my aim.
--
Matt Roberts


"Tom Ogilvy" wrote:

I don't see anything technically wrong with your code if that is what you
want.

If you have a cell in Periods_Range that is greater than .001, then you
should have a value in your array.

You will have empty elements in the array corresponding to any cell that is
less than or equal to .001 or for any elements that exceed the number of
cells in Periods_Range up to the 100th element.

--
Regards,
Tom Ogilvy


"Matt Roberts" wrote in message
...
I have written a function with the intention of iterating the function
(rather than the workbook) but am having difficulty pulling the

information
through:

Public Function Iterative_LIBOR(Target As Double, Frequent As Double,
Periods_Range As Range, Swaps_Range As Range, Nominals_Range As Range,
LIBORs_Range As Range)

Cycle = 1
Freq = Frequent
DCF = 0

'Build the Discount, Period, LIBOR and Nominal Arrays

Dim Period_Array(1 To 100) As Variant

For Each ActualCell In Periods_Range.Cells

If ActualCell.Value 0.001 Then

Period_Array(Cycle) = ActualCell.Value

Else
End If

Cycle = 1 + Cycle

Next ActualCell

Although the Range Periods_Range is populated with data the "Watch" gives
each value as "Empty". Can any one help?

Thank you
--
Matt Roberts




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
Adding data only if adjacent to cell labeled "male"/"female" lovesrubbaducky Excel Worksheet Functions 1 November 23rd 09 05:49 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Need formula like ISBLANK that returns "no value" even if there is aformula in referenced cell insitedge Excel Worksheet Functions 1 May 7th 08 01:27 PM
Finding cell that returns bad "solver_val" function. Box815 Excel Discussion (Misc queries) 1 January 4th 07 06:03 PM
Excel: can "go to adjacent empty cell" double-click be disabled? dgg2006 Excel Discussion (Misc queries) 1 April 8th 06 04:51 AM


All times are GMT +1. The time now is 10:37 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"