I have a sheet with a column that will contain 1 of 3 words sales, spot, demo. I want to search through this column and depending on which word I find enter another value in another cell.
I'm using a do while loop to go down through the cell I want to write in, and searching the column 3 back by offsetting. ( I understand this is not ideal but my sheets aren't that big and I can't make sense of some of the more efficient methods for searching because I am just starting out and don't really understand this language at all.)
This is what I have so far.
This kind of worked at first. If the cell had the word 'move' by itself it would find it. I tried using *, that didnt work. I tried changing .value to .find but it wouldnt let me do that. I also don't understand why it wont accept 'elseif'. (it highlights it in red) All the Q&As Ive found have been either way too basic and I cant apply the offsets or get 'then' to do anything, or they are using some other method and syntax that I can't figure out.
I'm using a do while loop to go down through the cell I want to write in, and searching the column 3 back by offsetting. ( I understand this is not ideal but my sheets aren't that big and I can't make sense of some of the more efficient methods for searching because I am just starting out and don't really understand this language at all.)
This is what I have so far.
Code:
Range("G2").Select Do Until Selection.Offset(0, -6).Value = ""
If Selection.Offset(0, -3).Value = "move" Then
Selection.Value = "mover
ElseIf Selection.Offset(0,-3).Value= "demo" Then
Selection.Value = "demo"
Else
Selection.Value="sale""
This kind of worked at first. If the cell had the word 'move' by itself it would find it. I tried using *, that didnt work. I tried changing .value to .find but it wouldnt let me do that. I also don't understand why it wont accept 'elseif'. (it highlights it in red) All the Q&As Ive found have been either way too basic and I cant apply the offsets or get 'then' to do anything, or they are using some other method and syntax that I can't figure out.