Prevost
Board Regular
- Joined
- Jan 23, 2014
- Messages
- 198
Hi,
I have the following code and what I would like to do is after the user has selected a range of cells, when they run the macro I want it to check each cell value to the left of the selected cells. If the cell to the left of the cell contains "ABC" then I would like the selected cell to have the value of "123". I thought this might work but it doesn't seem to. If anyone could help me out that would be great!
Thanks.
I have the following code and what I would like to do is after the user has selected a range of cells, when they run the macro I want it to check each cell value to the left of the selected cells. If the cell to the left of the cell contains "ABC" then I would like the selected cell to have the value of "123". I thought this might work but it doesn't seem to. If anyone could help me out that would be great!
Thanks.
Code:
Sub EnterRate()
Dim Cell As Range
For Each Cell In Selection
If Cell.Offset(0, -1) = "ABC" Then
Cell = "123"
End If
Next Cell
End Sub