Forum Discussion

rodsan724's avatar
rodsan724
Brass Contributor
Aug 28, 2023
Solved

Trying to assign Range.Offset to a variable

How do I assign Range.Offset to a variable?

 

 

Dim x As Range: x = rng.Offset(0,-1)

x.ClearContents

 

I'm getting Object required error message

 

  • rodsan724 

    You must use the keyword Set to assign an object:

     

    Set x = rng.Offset(0, -1)

     

    By the way, didn't you want

     

    x.ClearContents

  • rodsan724 

    You must use the keyword Set to assign an object:

     

    Set x = rng.Offset(0, -1)

     

    By the way, didn't you want

     

    x.ClearContents

Resources