Thread: Multiple IF 's
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Multiple IF 's

Hi Hans
try something like the following

sub foo()

select case range("H25").value
case 100
ID100
case 120
ID120
case else
msgbox "Sorry, not in list"
end select
end sub


--
Regards
Frank Kabel
Frankfurt, Germany


Hans Weustink wrote:
Hi,

I would like a macro to be selected based upon the value
of a cell.

so if H25 = 100 then run macro ID100
and if H25 = 120 then run macro ID120
etc.

And incorperating an else: MSG "Sorry (not in
list/error)" if the cell contains other argument.

TIA,
Hans