Forum Discussion
rodsan724
Aug 28, 2023Brass Contributor
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
- Aug 28, 2023
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
HansVogelaar
Aug 28, 2023MVP
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
- rodsan724Aug 28, 2023Brass ContributorThanks, I fixed in OP