Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default log based on cell values

Hi, all

Can someone explain to me why this code doesn't work? I get a 424 error and
the debugger points to the line I indicate below:

Sub volatility()
Sheets("HistoricalVolatility").Select
z = 2 + 1
vol = 0
Count = 0
Do While Cells(z, 7) < ""
vol = vol + Log(Cells(z, 7).Value) / Log(cell.Offset(-1, 0).Value) '
here's the prob
Count = Count + 1
z = z + 1
vol = vol / Count
Loop
Sheets("Options").Range("B9").Value = vol
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default log based on cell values

On Mar 25, 12:55*pm, bearly_competent
wrote:
Hi, all

Can someone explain to me why this code doesn't work? I get a 424 error and
the debugger points to the line I indicate below:

Sub volatility()
Sheets("HistoricalVolatility").Select
z = 2 + 1
vol = 0
Count = 0
Do While Cells(z, 7) < ""
* * vol = vol + Log(Cells(z, 7).Value) / Log(cell.Offset(-1, 0).Value) *'
here's the prob
* * Count = Count + 1
* * z = z + 1
* * vol = vol / Count
Loop
Sheets("Options").Range("B9").Value = vol
End Sub


"cell" should be "cells" it looks like. Is that it?

Chris
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default log based on cell values

if I use "cells", I get the error msg "sub or func not defined"

"cht13er" wrote:

On Mar 25, 12:55 pm, bearly_competent
wrote:
Hi, all

Can someone explain to me why this code doesn't work? I get a 424 error and
the debugger points to the line I indicate below:

Sub volatility()
Sheets("HistoricalVolatility").Select
z = 2 + 1
vol = 0
Count = 0
Do While Cells(z, 7) < ""
vol = vol + Log(Cells(z, 7).Value) / Log(cell.Offset(-1, 0).Value) '
here's the prob
Count = Count + 1
z = z + 1
vol = vol / Count
Loop
Sheets("Options").Range("B9").Value = vol
End Sub


"cell" should be "cells" it looks like. Is that it?

Chris

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default log based on cell values

On Mar 25, 1:24*pm, bearly_competent
wrote:
if I use "cells", I get the error msg "sub or func not defined"



"cht13er" wrote:
On Mar 25, 12:55 pm, bearly_competent
wrote:
Hi, all


Can someone explain to me why this code doesn't work? I get a 424 error and
the debugger points to the line I indicate below:


Sub volatility()
Sheets("HistoricalVolatility").Select
z = 2 + 1
vol = 0
Count = 0
Do While Cells(z, 7) < ""
* * vol = vol + Log(Cells(z, 7).Value) / Log(cell.Offset(-1, 0).Value) *'
here's the prob
* * Count = Count + 1
* * z = z + 1
* * vol = vol / Count
Loop
Sheets("Options").Range("B9").Value = vol
End Sub


"cell" should be "cells" it looks like. Is that it?


Chris- Hide quoted text -


- Show quoted text -


Then try using this:
vol = vol + Log(Cells(z, 7).Value) / Log(Cells(z-1,7).Value)

I think that will work .. post again if it doesn't!

Chris
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
Counting values in one cell based on values in another S2 Excel Discussion (Misc queries) 7 April 18th 09 02:46 AM
Copy values from a cell based on values of another cell Spence10169 Excel Discussion (Misc queries) 4 January 13th 09 10:01 AM
How to assign values to a cell based on values in another cell? Joao Lopes Excel Worksheet Functions 1 December 5th 07 09:02 PM
VAB to copy cell values into new Sheet, Overwrite if needed and based off of Cell Value in a column gumby Excel Programming 4 July 14th 07 01:55 AM
Search/Filter to find values in another range based on two cell values Andy Excel Programming 2 April 29th 04 04:08 PM


All times are GMT +1. The time now is 02:07 AM.

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"