If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Newbe help - VBA function
Newbe needs help
I'm creating a function for Excel. I want the function to operate two different ways depending on the contents of a sell. Like If cell A1 (AB in VBA function ) is A then Va * Vb If cell A1 (AB) is B then Va * Vc In Excel IF function terms I'm wanting to: =IF(AB = "A",Va*Vb,IF(AB = "B",Va*Vc,"-")) So what should my function be in VBA: Function test(AB, Va, Vb, Vc) ?? where to from here Thankyou for your help Kristen |
#2
|
|||
|
|||
Newbe help - VBA function
Function test(AB,Va,Vb,Vc)
IF AB="A" then test=Va * Vb ElseIf AB = "B" then test = Va * Vc Else test = "-" End If End Function Bob Umlas Excel MVP "Kristen" wrote in message om... Newbe needs help I'm creating a function for Excel. I want the function to operate two different ways depending on the contents of a sell. Like If cell A1 (AB in VBA function ) is A then Va * Vb If cell A1 (AB) is B then Va * Vc In Excel IF function terms I'm wanting to: =IF(AB = "A",Va*Vb,IF(AB = "B",Va*Vc,"-")) So what should my function be in VBA: Function test(AB, Va, Vb, Vc) ?? where to from here Thankyou for your help Kristen |
#3
|
|||
|
|||
Newbe help - VBA function
Thankyou Bob
I'll put it in my function. Thankyou Kristen "Bob Umlas" wrote in message ... Function test(AB,Va,Vb,Vc) IF AB="A" then test=Va * Vb ElseIf AB = "B" then test = Va * Vc Else test = "-" End If End Function Bob Umlas Excel MVP "Kristen" wrote in message om... Newbe needs help I'm creating a function for Excel. I want the function to operate two different ways depending on the contents of a sell. Like If cell A1 (AB in VBA function ) is A then Va * Vb If cell A1 (AB) is B then Va * Vc In Excel IF function terms I'm wanting to: =IF(AB = "A",Va*Vb,IF(AB = "B",Va*Vc,"-")) So what should my function be in VBA: Function test(AB, Va, Vb, Vc) ?? where to from here Thankyou for your help Kristen |
Thread Tools | |
Display Modes | |
|
|