Search code examples
vbarangecell

Can't set range variable to ActiveCell.Offset


As far as I know, this should be a working syntax. However, when I run this, I get:

Method 'Range' of object '_Global' failed

Dim rngColor as Range
Set rngColor = Range(ActiveCell.Offset(0, 1))

Any idea what I am doing wrong? Thanks!


Solution

  • You can delete the range() and simply, as

    Dim rngColor as Range
    Set rngColor = ActiveCell.Offset(0, 1)