Set variable to active cell address
rng = ActiveCell gives value
rng = ActiveCell.Address gives cell reference in A1 format
Set rng = ActiveCell is used to set the active cell as an object variable
range
then you cans do: x = rng.address to get a cell string in A1 format.
I get screwed around on these also. The best way to do it is to use a Range
or Cells reference if you can. If you have to have a variable, then don't
forget that it is a cell reference and you will need to use it like
Range(rng) when setting a range reference.
"shelfish" wrote:
I just need to set the value of a variable to the "A1" address of the
active cell. I feel like I've tried everything, but shouldn't this
work....
Dim rng as Range
Set rng = activecell [results in active cell's
value]
Set rng = activecell.address [throws error]
Thanks all,
Shelton.
|