PDA

View Full Version : if statement



runningpiema
03-22-2013, 03:09 PM
Hi thre,

I have a spread sheet that has the following.

0 - 20 = $100
21 - 50 = $200

in the macro when it populates from another spreadsheet it has a number that number needs to be able to be linked to the above statment, i asume it is an IF statment but dont quite now how to set it up.

Hope you can help.

Thanks,
Gordon

enrand22
03-23-2013, 10:38 AM
may be like this:


if activecell.value >= 0 and activecell.value <= 20 then

activecell.offset(0,1).value = 100

elseif activecell.value >= 21 and activecell.value <= 50 then

activecell.offset(0,1).value = 200

end if


i dont know what or where you write de 100 and 200 price, i put it next to it.

sassora
03-25-2013, 12:00 AM
How is the data set up in your other file? you may be able to use a vlookup function.