Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro help
hey guys' need help writing this formula as a macro, i need to nest an infinite number of packs =IF(B1="2pack",H1/4,IF(B1="3 packl",H1/15,IF(B1="4 pack",H1/15,"not"))) thanks jason -- jwfakouri ------------------------------------------------------------------------ jwfakouri's Profile: http://www.excelforum.com/member.php...o&userid=31435 View this thread: http://www.excelforum.com/showthread...hreadid=514024 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro help
Hi
Why don't you create a table with all your packs and division factors, and then use Vlookup to retrieve same? "jwfakouri" wrote: hey guys' need help writing this formula as a macro, i need to nest an infinite number of packs =IF(B1="2pack",H1/4,IF(B1="3 packl",H1/15,IF(B1="4 pack",H1/15,"not"))) thanks jason -- jwfakouri ------------------------------------------------------------------------ jwfakouri's Profile: http://www.excelforum.com/member.php...o&userid=31435 View this thread: http://www.excelforum.com/showthread...hreadid=514024 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro help
jason,
Maybe something like this... '---------------------------------- Function WhackAMole() As Double Dim strName As String Dim dblValue As Double Dim dblAnswer As Double strName = Range("B1").Text dblValue = Range("H1").Value2 Select Case strName Case "2pack" dblAnswer = dblValue / 4 Case "3pack" dblAnswer = dblValue / 15 Case "4pack" dblAnswer = dblValue / 15 'enter as many more as you need... Case Else dblAnswer = 0 End Select WhackAMole = dblAnswer End Function '------------------------------------ Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "jwfakouri" wrote in message hey guys' need help writing this formula as a macro, i need to nest an infinite number of packs =IF(B1="2pack",H1/4,IF(B1="3 packl",H1/15,IF(B1="4 pack",H1/15,"not"))) thanks jason jwfakouri |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) |