Using the And formula in a VBA macro
I'm learning VBA and have got stuck!
I have a spreadsheet with 7 columns of information. I want to work
down the spreadsheet, testing 4 criteria. The critera look at the
columns and test to see if they apply. I can use the And function to
return a true or false value.
I want to use VBA to say that if a particular condition applies then
put 'text1' in the cell to the right, if not test the next condition
and if that is true then put 'text2' in the cell to the right, if not
test the next condition.
I've recorded the macro and am using an activecell.formula = approach.
I just can't get it to run in an Else If way. The first test runs
but the second doesn't. I can't put an if statement before the
activecell.formula.
Has anyone got any ideas on how to overcome this?
Much appreciated
Corinne R
|