Trying to build a Select Case statement that does a similar job to a nested if function. Essentially I want to give a cell a value (in Column i + 1) based on values of two columns (column P and column I) and then apply it to a down the whole column of numbers down to the lastrow (hence lr variable)
Currently, I am getting type mismatch error on the select case line.
Dim i As Long
Dim RowNum As Long
Dim lr As Long
Set i = 10
RowNum = 2
lr = Worksheets("1").cells.Find("*", cells(1, 1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
Set tbl = ActiveSheet.ListObjects("1")
Do Until cells(RowNum, i + 1) = lr
Select Case cells(RowNum, "P") And cells(RowNum, "I").Value
Case Is = "1" And "Available"
cells(RowNum, i + 1).Value = "Purchase"
Case Is = "2" And "Not Available"
cells(RowNum, i + 1).Value = "Attempt Purchase"
Case Is = "3"
cells(RowNum, i + 1).Value = "Purchase Automatic"
Case Is = "4"
cells(RowNum, i + 1).Value = "Do not Purchase"
Case Else
cells(RowNum, i + 1).Value = "N/A"
End Select
RowNum = RowNum + 1
Loop
Any help is greatly appreciated. Thanks