Refer to Excel Cells Relative to Other Cells VBA

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.

Macro code:

Sub UnderlineDouble()

ActiveCell.Offset(0, 2).Font.Underline = xlDouble

End Sub

Watch the video:

Further reading:

Excel Cell References. Relative and Absolute Cell References

Leave a Reply

Your email address will not be published. Required fields are marked *