Forum Discussion

Eric Rowland's avatar
Eric Rowland
Copper Contributor
Nov 17, 2017

Testing .interior.colorindex using Range method and structured reference

If Range("matrixtable[@endoftcLE]").Interior.ColorIndex <> 36 Then _
  Range("matrixtable[@endoftcLE]") = Application.VLookup(sDetailLeft, sectiondata, Application.Match("endoftc", sectionheaders, 0), False)

The statement generates the error "Method 'Range' of object '_Worksheet" failed".

This is part of code which runs on a Private Sub Worksheet_Change(ByVal Target As Range).

The table matrixtable is on the worksheet.

Is the test looking at the .Value of the Range instead of the cell itself?

If so, how do I modify the test to look at the cell?

If I use Cells instead of Range, can I still use the structured reference?

No RepliesBe the first to reply

Resources