#1
|
|||
|
|||
VBA Macro computational
Hi,
May I ask the VBA Macro on how to apply IF condition and with corresponding computation. Let us say: 1. I have a drop down menu in cell B2 that features Quantity of an item, cell C2 has the drop down menu of Print (service), cell D2 contains a drop down for Short bondpaper corresponding to the Size of the paper. 2. After I select those options like B2: 5 (quantity), C2: Print (type of service), D2: Short (size) it will return the value for 15 bucks. In every 5 quantities of short bondpaper is worth 15. The value 15 will be displayed in cell D5 Thanks. Last edited by sheen.buhay; 08-26-2011 at 11:10 PM. |
#2
|
|||
|
|||
can you upload a sample workbook with sample data?
and details on how a selection made in cells B5 will affect the result |
#3
|
|||
|
|||
It seems I can't find the upload facility on the quick reply post. Please walk me through on how to upload the file on this thread.
Thanks. |
#4
|
|||
|
|||
Re: VBA Macro computational
Attached is the excel spreadsheet without the macro.
The sample excel provides you the ability to select appropriate options and thus provides the desired results according to the selected data. |
#5
|
|||
|
|||
try this formula: (replace red values as necessary) same formula in sample attached)
how many combinations can be in Columns C and D? If there are too many, we need another approach... =IF(AND(C2="Xerox";D2="Short")=TRUE;B2*2;IF(AND(C2="Print";D2="Short")=TRUE;B2*3;IF(AND(C2="Xerox";D2="Long")=TRUE;B2*5;IF(AND(C2="Print";D2="Long")=TRUE;B2*4;"")))) |
#6
|
|||
|
|||
Thanks Catalin for your reply however I have no problem with the conditional statement with formula. What I want to achieve is to convert those behavior to VBA Macro.
Thanks. |
#7
|
|||
|
|||
you can try the sample attached...
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I assign a macro to a button when the macro is in my personal workbook? | foolios | Excel Programming | 2 | 07-27-2011 02:41 PM |