I have tried the code suggested in the question linked at the bottom but get an error on the line:
Set getNthColumn = Range(startCell, endCell)
The error is
Method ‘Range’ of object ‘_Worksheet’ failed
This code is supposed to set the colour formatting of a range cells whose formula is a VLOOKUP.
All help appreciated.
Apparently you put the code into a worksheet’s code module.
In that case
Range() resolves to
Worksheet.Range() of that worksheet. If
endCell belong to a different sheet you will get an error.
If you put the code in a plain module, as the OP specifically requested,
Range() would then mean
Application.Range(), and that would properly construct your range.
You can get rid of that ambiguity by explicitly using