Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Translating Dates to a Visual | Excel Worksheet Functions | |||
Translating | Excel Discussion (Misc queries) | |||
Translating formulas | Excel Discussion (Misc queries) | |||
Translating an IF formula from Lotus 1-2-3 to Excel | Excel Worksheet Functions | |||
Translating function names | Excel Discussion (Misc queries) |