Home |
Search |
Today's Posts |
#1
|
|||
|
|||
how i can call the function
Hi .... i have a problem that how i can call a function in Excel VBA the
problem is. public function price(item) if(item = "apple") then price =10 tax=0.2 elseif(item="orange") then price =8 tax=0.5 end if end function But now how to get the exact tax number of apple which is 0.2 thanks in advance |
#2
|
|||
|
|||
I'd recommend against using a function in that way. It means a programmer is
required every time and item is added, a price changes or a tax rate changes. Why not use a lookup instead? http://www.techonthenet.com/excel/formulas/lookup.htm http://www.cpearson.com/excel/lookups.htm Steve "reneabesmer" wrote in message ... Hi .... i have a problem that how i can call a function in Excel VBA the problem is. public function price(item) if(item = "apple") then price =10 tax=0.2 elseif(item="orange") then price =8 tax=0.5 end if end function But now how to get the exact tax number of apple which is 0.2 thanks in advance |
#3
|
|||
|
|||
set up a table like so in say H1:K20
item price tax apple 10 0.2 orange 8 .5 etc. and us =vlookup(A1,$H$1:$K$20,2,False)*VLOOKUP(A1,$H$1:$K $20,3,False) -- HTH RP (remove nothere from the email address if mailing direct) "reneabesmer" wrote in message ... Hi .... i have a problem that how i can call a function in Excel VBA the problem is. public function price(item) if(item = "apple") then price =10 tax=0.2 elseif(item="orange") then price =8 tax=0.5 end if end function But now how to get the exact tax number of apple which is 0.2 thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
clock | Excel Worksheet Functions | |||
Need a ISWorkday Function -- Any Ideas | Excel Worksheet Functions | |||
Conversion | Excel Worksheet Functions | |||
Using Function to call Woorbook Sheet | Excel Discussion (Misc queries) | |||
How to call a function from another workbook | Excel Discussion (Misc queries) |