Reputation: 7
I am trying to activate the range 4 across and 'n' down from the current active cell. I am new to VBA and programming as a whole.
I have tried putting each "ActiveCell.Offset(0, 0)" in its own parentheses and without. It also works with the first as "ActiveCell.Offset(0, 1)" but I want the upper left cell in the activated range to be the original ActiveCell
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(n, 4)).Activate
When I put ActiveCell.Offset(0, 0) in their own parentheses I get an error message "method 'range' of object '_global' failed". Ran without the parentheses it just does nothing at all without an error.
Upvotes: 0
Views: 2158
Reputation: 53137
From the documentation
Range.Activate method
Activates a single cell, which must be inside the current selection. To select a range of cells, use the Select method.
So, your code could be
Range(ActiveCell, ActiveCell.Offset(n, 4)).Select
That said, consider not using Activate/Select at all. See here for how.
Upvotes: 2