I have managed to get my VBA to use active cell to retrieve date and department number on my table. I am using this for advance filtering. I would like help in shortening up my code, the way I am going it would take quite a few lines. I have tried to add a message box that would say “No NCR” if cell valve = 0. I would also like message "Click on cell in table" if button is selected and the active cell is not in table range. 

```vb
Sub select Range()

If ActiveCell.Address = "$B$7" Then
Range("O6").Value = Range("B5").Value
Range("Q6").Value = Range("A7").Value

ElseIf ActiveCell.Address = "$B$8" Then
Range("O6").Value = Range("B5").Value
Range("Q6").Value = Range("A8").Value

ElseIf ActiveCell.Address = "$B$9" Then
Range("O6").Value = Range("B5").Value
Range("Q6").Value = Range("A9").Value

End If
End Sub

```

[Table Data](https://i.stack.imgur.com/0AxK4.jpg)