LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Need help on Logical Statements

I am trying to building a simple commission calculator at work to make things easier using VBA

Have about 15 countries we trade in with commssions broken down as follows (data as shown on spead
sheet):

A B C D E F G H I J

Values up to up to up to up to up to up to up to up to and up
5,000 10,000 20,000 30,000 40,000 50,000 60,000 70,000 80,000
Countries
9 U.K. $80. $130. $150. $165. $180. $200. $300. $375. $400.
10 Hong Kong $120. $150. $185.
11 Singapore $250. " " " "
12 South Africa " " " "
13 France " "
14 Germany " "
" " etc.
" "
" "
etc.

In cells A2, I created a pull down menu where you can select the appropriate country [ data /
validation . . .]
In cell A4 = (quantity) and cell A5 = (price) giving the Value amount in cell A7 =(a4*a5)
I would like the correct commission to appear in cell A8

I have started the following code in VBA for this project however having difficulty to get it to
work also not sure if it is the most efficient way of doing things, I am a novice, still learning
and trying to keep it as simple as possible.

If cells(9, "a").Value = "U.K." and cells(7, "a").Value 0 <=5000
Then cell(8, "a") = cells(9, "b").Value
Elseif cells(9, "a").Value = "U.K." and cells(7, "a").Value 10000 <=20000
Then cell(8, "a") = cells(9, "c").Value
Elseif cells(9, "a").Value = "U.K." and cells(7, "a").Value 5000 <=10000
Then cell(8, "a") = cells(9, "d").Value
" "
" "
If cells(9, "a").Value = "Hong Kong" and cells(7, "a").Value 0 <=5000
Then cell(8, "a") = cells(10, "b").Value
Elseif cells(9, "a").Value = "Hong Kong" and cells(7, "a").Value 10000 <=20000
Then cell(8, "a") = cells(10, "c").Value
" "
" "
Else: cells(8, "a") = ""
End if


Your help is appreciated


 
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
Logical IF statements Matt Excel Worksheet Functions 3 August 5th 08 10:39 AM
what formula for summing if two logical statements are true? steve95959 Excel Worksheet Functions 2 April 29th 08 11:07 PM
Intervals as logical statements xnadeau Excel Worksheet Functions 3 October 25th 05 08:35 PM
Logical ELSE statements Ruth Excel Discussion (Misc queries) 2 June 23rd 05 03:23 PM
Logical Function - Multiple IF statements vnsrod2000 Excel Worksheet Functions 7 February 4th 05 10:42 PM


All times are GMT +1. The time now is 06:53 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"