Macro to Refer to Excel cells relative to other worksheet cells using offset
We can refer to Excel cells relative to other worksheet Excel cells using an Excel macro. A common way to work with an Excel cell relative to another cell in Microsoft Excel is to use the Offset property. In the following example, the contents of the Excel worksheet cell that’s in the same row and two columns to the right from the active cell on the active Excel worksheet is formatted as double-underlined. The total value is double underlined.
ActiveCell.Offset(0, 2).Font.Underline = xlDouble
Watch the video: