Lobo de Colorado
Lobo de Colorado

Reputation: 307

VBA: Select Value 25 Cells To Left

How do I select the value from a cell 25 columns to the left of my active cell? Same row.

Range("AF1").Select
Dim i As Integer
Dim j As Integer
For i = 26 To 2 Step -1
    value = Range(rc[-i]).Value

Is my current train of thought. I want to run through every cell until I'm 2 away.

Upvotes: 0

Views: 2650

Answers (1)

R Hamilton
R Hamilton

Reputation: 263

you would use the offset property. i.e.

Sub getOffset()
  Range("AF1").Select
  ActiveCell.Offset(rowOffset:=0, columnOffset:=-25).Activate
End Sub

Upvotes: 3

Related Questions