I am trying to define VBA in Excel 2013 if ActiveCell is not only in any table, but also in a specific table.
The code below is as is, but only detects that ActiveCell is in any table. The commented line is what I'm looking for, but obviously this does not work.
...
Set rng = Intersect (.EntireRow, ActiveCell.ListObject.DataBodyRange)
'Set rng = Intersect (.EntireRow, ActiveCell.ListObjects ("myTable"). DataBodyRange)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "Please select the cell of a row within the consensus input table.", VbCritical, "Delete Evaluator"
Else
...
Any suggestions on the correct syntax for this?
Thanks!
source
share