VAB question

T

Tang

Dear all, how to combine these 3 lines into 1 line in the macro?

If Right(Cells(r, 9).Value, 1) = "1"
If Right(Cells(r, 9).Value, 1) = "2"
If Right(Cells(r, 9).Value, 1) = "3"


regards
 
F

Frank Kabel

Hi
what are you trying to achieve?. maybe
If Right(Cells(r, 9).Value, 1) = "1" or _
Right(Cells(r, 9).Value, 1) = "2" or _
Right(Cells(r, 9).Value, 1) = "3" then
'do your stuff
end if

or maybe better
dim vRes
vRes=Right(Cells(r, 9).Value, 1)
if vRes="1" or vRes="3" or vRes="3" then
'do your stuf
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top