Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the cells below as follows:
Cell B1 = Country Cell B4 = Amount (denominated in foreign currency) Cell B5 = Amount (denominated in U.S. Dollars) Cells D1 through D20 (shows a specific foreign exchange rate for each country listed in B1) I wish to use Select Case, instead of the IfElse statements to execute the following cells as shown example below: If cell B1 = United Kingdom then cell B5 = B4 * D1 else leave cell B5 blank. If cell B1 = Hong Kong then cell B5 = B4 / D2 else leave cell B5 blank. I need help to get me started, how would I write the syntax to perform this example. For example: Cell B1 = United Kingdom Cell B4 = 2000. (GBP) Cell D1 = 1.45 (exchange rate) then cell B5 would show the figure $2,900. USD I specifically don't know the syntax used that makes reference to specific cells. Thank you, Susan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Select Case Range("B1").Value
Case "United Kingdom": Range("B5").Value = Range("B4").Value * _ Range("D1").Value Case "Hong Kong": Range("B5").Value = Range("B4").Value / _ Range("D2").Value End Select -- HTH RP (remove nothere from the email address if mailing direct) "Susan Hayes" wrote in message ... I have the cells below as follows: Cell B1 = Country Cell B4 = Amount (denominated in foreign currency) Cell B5 = Amount (denominated in U.S. Dollars) Cells D1 through D20 (shows a specific foreign exchange rate for each country listed in B1) I wish to use Select Case, instead of the IfElse statements to execute the following cells as shown example below: If cell B1 = United Kingdom then cell B5 = B4 * D1 else leave cell B5 blank. If cell B1 = Hong Kong then cell B5 = B4 / D2 else leave cell B5 blank. I need help to get me started, how would I write the syntax to perform this example. For example: Cell B1 = United Kingdom Cell B4 = 2000. (GBP) Cell D1 = 1.45 (exchange rate) then cell B5 would show the figure $2,900. USD I specifically don't know the syntax used that makes reference to specific cells. Thank you, Susan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select Case ignored | Excel Worksheet Functions | |||
Case without Select Case error problem | Excel Discussion (Misc queries) | |||
For Each with Select Case | Excel Programming | |||
For Each with Select Case | Excel Programming | |||
help on select case | Excel Programming |