0
votes

I have a cell selected in a row. I would like the selection to stay on the same row, but move to a range of cells on the same row that are in specific columns.

I have moved down one cell and selected a range of cells and deleted the contents like this:

ActiveCell.Offset(1, 0).Range("S1,A1:Q1").Select
Application.CutCopyMode = False
Selection.ClearContents

Now I would like to select columns 37:39 on that same row.
Is there a function to just move over to a specific column?

1
This might help you in general: How to avoid using Select in Excel VBAerazorv4

1 Answers

0
votes

Consider:

Sub marine()
    Dim rw As Long
    rw = Selection.Row
    Range(Cells(rw, 37), Cells(rw, 39)).Select
    MsgBox Selection.Address(0, 0)
End Sub

enter image description here