PDA

View Full Version : [SOLVED:] VBA: Select cell thats two columns ahead and make changes to it (and current cell)



noname91
03-19-2020, 01:06 PM
Hello again,

A simple issue in VBA. I need to get the cell that is the same row as the Selection cell, but two columns ahead. How would I access that cell in order to make changes to both the Selected cell, and the cell that's two columns ahead and on the same row?

My code to edit the Selected cell:


With Selection
.NumberFormat = "General"
.WrapText = True
End With

Basically something like "With Selection+2", but obviously the syntax would be far different.

Thanks in advance!

Paul_Hossler
03-19-2020, 01:11 PM
With Selection.Offset(0,2)


End With

noname91
03-19-2020, 01:24 PM
Thank you for the quick reply Paul_Hossler. Works perfectly!