#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Select Case

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Select Case

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Case ignored Preschool Mike Excel Worksheet Functions 4 September 9th 09 08:12 PM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
For Each with Select Case helmekki[_31_] Excel Programming 0 October 15th 04 03:49 AM
For Each with Select Case helmekki[_30_] Excel Programming 0 October 15th 04 03:36 AM
help on select case [email protected] Excel Programming 2 February 24th 04 06:40 PM


All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"