PDA

View Full Version : [SOLVED] Entering a value to a range of cells which are -1 column from cells selected



Palon
11-16-2014, 12:16 PM
Dear All,

After selecting several cells in a single column, I want the code to enter a text value to all the cells next to them eg.

1. Selected cells are F3, F5, F20 and the code enters a phrase "text" to cells E3, E5, E20.

2. Application:

After all cells starting with number 81 have been selected from the column below - phrase "Germany" is inserted into a corresponding cell in a column next to it.

8144751
5202847
5401927
8100898
8922131
2700299

Your help is very appreciated.

Thank you :)

GarysStudent
11-16-2014, 12:38 PM
Try this:



Sub qwerty()
Selection.Offset(0, -1).Value = "text"
End Sub

Palon
11-16-2014, 12:52 PM
And yet again - this works just great.

You Sir are double awesome!

Thank you - that just made my life a lot easier (twice now) :)