IF formula

  • Thread starter Thread starter John C Williams
  • Start date Start date
J

John C Williams

Hi

In the days of Qbasic (yes that long ago) I used to be able to type
something similar to:-
Enter A
IF A=<999 then PRINT "Too low"
Enter A
If A=>1000 AND IF A=<3999 then PRINT "Linz"
IFA=>4000 AND IF A=<5999 then PRINT "Vienna"
and so on.

It's a little program to establish the nearest airport to a given post code
in a given country.

I can't figure out how to do this in Excel.

Any help appreciated.

TIA

John

--



_______________________
Check out Xtreme Release
http://xtreme.nlpc.co.uk
 
John

for Enter A, use A = INPUTBOX and for PRINT, use MSGBOX. Look up the
details in the Help

It would look something like:

Sub Airports()
a = InputBox("Enter the distance", "Distance", 0)
If a <= 999 Then MsgBox "Too low"
a = InputBox("Enter the distance", "Distance", 0)
If a >= 1000 Then If a <= 3999 Then MsgBox "Linz"
If a >= 4000 Then If a <= 5999 Then MsgBox "Vienna"
End Sub

Regards

Trevor
 
Thanks, I'll try that
John
Trevor Shuttleworth said:
John

for Enter A, use A = INPUTBOX and for PRINT, use MSGBOX. Look up the
details in the Help

It would look something like:

Sub Airports()
a = InputBox("Enter the distance", "Distance", 0)
If a <= 999 Then MsgBox "Too low"
a = InputBox("Enter the distance", "Distance", 0)
If a >= 1000 Then If a <= 3999 Then MsgBox "Linz"
If a >= 4000 Then If a <= 5999 Then MsgBox "Vienna"
End Sub

Regards

Trevor
 
Back
Top