VAB question

  • Thread starter Thread starter Tang
  • Start date Start date
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
 
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
 
Back
Top