Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Translating spreadsheet formula to VBA

I have this formula in worksheet:

=COS(ATAN(E13/E14))

I want to create this formula in VBA but its not
available in the library.

I'm new to this VBA. I'll really appreciate if anybody
could help me out in this.

Thanks.

Sheela
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Translating spreadsheet formula to VBA

First, check HELP for the correct functions.
Generally, you could use EITHER the VB function OR the
Worksheet function, so check them both out.

1) Using the VB function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Tan(V1 / V2)
MyATAN = Cos(first)
End Function

2) Using the worksheet function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Application.WorksheetFunction.Atan2(V1, V2)
MyATAN = Application.WorksheetFunction.Cosh(first)
End Function


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have this formula in worksheet:

=COS(ATAN(E13/E14))

I want to create this formula in VBA but its not
available in the library.

I'm new to this VBA. I'll really appreciate if anybody
could help me out in this.

Thanks.

Sheela
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Translating spreadsheet formula to VBA

Hello,

Thanks for your help. I guess I can use the first
function. How do I call this function to that particular
textbox. I'm not linking VB with the spreadsheet but I
have designed a form using the dialog box and when I run
excel, it will popup this form.

My question is, can I use the VB function which was
suggested to me or is there another way of doing it?

Thanks.

Sheela


-----Original Message-----
First, check HELP for the correct functions.
Generally, you could use EITHER the VB function OR the
Worksheet function, so check them both out.

1) Using the VB function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Tan(V1 / V2)
MyATAN = Cos(first)
End Function

2) Using the worksheet function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Application.WorksheetFunction.Atan2(V1, V2)
MyATAN = Application.WorksheetFunction.Cosh

(first)
End Function


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have this formula in worksheet:

=COS(ATAN(E13/E14))

I want to create this formula in VBA but its not
available in the library.

I'm new to this VBA. I'll really appreciate if anybody
could help me out in this.

Thanks.

Sheela
.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Translating spreadsheet formula to VBA

Your question bears no relation to your initial question.

In a sheet use =MyAtan(A1,A2)
replacing MyAtan with your function name and A1 and A2 by
whatever cell references you want.
In VB

MyResult = MyAtan(Var1,Var2)


If you wnat the result in a textbox on a userform then
Textbox1.Text = Format$(MyResult,"0.0")

HTH
Patrick Molloy
Microsoft Excel MVP



-----Original Message-----
Hello,

Thanks for your help. I guess I can use the first
function. How do I call this function to that particular
textbox. I'm not linking VB with the spreadsheet but I
have designed a form using the dialog box and when I run
excel, it will popup this form.

My question is, can I use the VB function which was
suggested to me or is there another way of doing it?

Thanks.

Sheela


-----Original Message-----
First, check HELP for the correct functions.
Generally, you could use EITHER the VB function OR the
Worksheet function, so check them both out.

1) Using the VB function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Tan(V1 / V2)
MyATAN = Cos(first)
End Function

2) Using the worksheet function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Application.WorksheetFunction.Atan2(V1, V2)
MyATAN = Application.WorksheetFunction.Cosh

(first)
End Function


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have this formula in worksheet:

=COS(ATAN(E13/E14))

I want to create this formula in VBA but its not
available in the library.

I'm new to this VBA. I'll really appreciate if anybody
could help me out in this.

Thanks.

Sheela
.

.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Translating spreadsheet formula to VBA

Dear Patrick,

Thank you very much for your help. It worked!!

Rgrds,
Sheela

-----Original Message-----
Your question bears no relation to your initial question.

In a sheet use =MyAtan(A1,A2)
replacing MyAtan with your function name and A1 and A2

by
whatever cell references you want.
In VB

MyResult = MyAtan(Var1,Var2)


If you wnat the result in a textbox on a userform then
Textbox1.Text = Format$(MyResult,"0.0")

HTH
Patrick Molloy
Microsoft Excel MVP



-----Original Message-----
Hello,

Thanks for your help. I guess I can use the first
function. How do I call this function to that

particular
textbox. I'm not linking VB with the spreadsheet but I
have designed a form using the dialog box and when I

run
excel, it will popup this form.

My question is, can I use the VB function which was
suggested to me or is there another way of doing it?

Thanks.

Sheela


-----Original Message-----
First, check HELP for the correct functions.
Generally, you could use EITHER the VB function OR the
Worksheet function, so check them both out.

1) Using the VB function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Tan(V1 / V2)
MyATAN = Cos(first)
End Function

2) Using the worksheet function
Function MyATAN(V1 As Double, V2 As Double) As Double
Dim first As Double
Application.Volatile
first = Application.WorksheetFunction.Atan2(V1, V2)
MyATAN = Application.WorksheetFunction.Cosh

(first)
End Function


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have this formula in worksheet:

=COS(ATAN(E13/E14))

I want to create this formula in VBA but its not
available in the library.

I'm new to this VBA. I'll really appreciate if

anybody
could help me out in this.

Thanks.

Sheela
.

.

.

.



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
Translating Dates to a Visual english4518 Excel Worksheet Functions 2 September 10th 09 02:43 AM
Translating Erika Excel Discussion (Misc queries) 0 June 6th 08 03:13 PM
Translating formulas Cameron Excel Discussion (Misc queries) 9 August 3rd 06 11:43 AM
Translating an IF formula from Lotus 1-2-3 to Excel fsufan13 Excel Worksheet Functions 6 November 4th 05 12:34 AM
Translating function names dziw Excel Discussion (Misc queries) 2 June 30th 05 04:37 AM


All times are GMT +1. The time now is 06:50 AM.

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"