Prev Previous Post   Next Post Next
  #1   Report Post  
Member
 
Posts: 57
Question formula code

Hi there, hopefully this is simple!! I've asked the same question as the last entry on my last question but it could get lost t the bottom there!



I have been given the following code (the solution is
7.51240351575601)

Sub TestiT()
Dim a, b, f, p
a = 1430
b = 1651
f = 7984
p = 600
Debug.Print Find_x(a, b, f, p)
End Sub



Function Find_x(a, b, f, p)
Dim x As Double
Dim t As Double
Dim j As Long
x = 0
t = 1
Do While x t (THIS MAKES A COMPILE ERROR SO I CHANGED TO COMBINATIONS OF xt,xt, x<t and x=t )
t = x
x = x + (a + (b - f) * Tan(x) - p * Cos(x)) / _
(f - b + a * Tan(x) - 2 * p * Sin(x))
Loop
Find_x = x
End Function


How do I put this in my workbook?
I have tried pasting it into both the worksheet and a seperate module and having the formula =find_x(a,b,f,p) in the cell i need the result but I just get a #value error, when I evaluate the formula I get #NAME errors for a,b,f,p

By the way values for a,b,f,p are on the sheet with cell references b2,b3,b4 & b5. If I change a=1430 to a="b2" or a=b2 I still get the same error.

Have had a look at various resources to find out what I'm doing wrong here but its difficult with such a wide range of search terms to enter.

Anybody able to point me in the right direction?

Cheers
Nobby
 
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
Formula Help Price Code natei6 Excel Worksheet Functions 1 March 4th 06 02:29 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Formula for Extracting Alphabetic Part of a Product Code ob3ron02 Excel Worksheet Functions 1 October 29th 04 06:07 PM


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