Hello,
I need to select a cell at the left side of the active cell using an offset, as I’m working with dynamic ranges. When I do this, i.e:
Range(“B1”).Offset(0, -1).Select
selects both B1 and A1 cells, but i want it to select only A1 cell.
Googled it but haven’t found anything so far.
Any ideas?
First you said that you want to select a cell at the left side of the active cell but your code is specific to B1.
If I wanted to select a cell at the left side of the active cell I would use:
ActiveCell.Offset(0, -1).Select
That said, there’s 2 other things I’d like to mention:
1 – When I use your code, it selects A1 only, not A1:B1.
Try this and tell us what you get:
MsgBox Range(“B1”).Offset(0, -1).Address
It should return $A$1.
2 – Why are you Selecting a cell? You rarely need to Select a cell via VBA in order to perform an operation on it.
For example:
Can be reduced to:
You can typically perform the VBA operation directly on the Range from within VBA.
It’s much more efficient/quicker.
Click Here Before Posting Data or VBA Code —> How To Post Data or Code.