0

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?

Asger
  • 3,822
  • 3
  • 12
  • 37
  • 1
    This might help you in general: [How to avoid using Select in Excel VBA](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba) – erazorv4 May 24 '19 at 12:55

1 Answers1

0

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

Gary's Student
  • 95,722
  • 10
  • 59
  • 99