I've been trying to implement excel VBA's at work. I have to manually categorise each keyword into categories and my current process is a simple text filter contains then manually add to all cells (GIF to demonstrate at the bottom of the post).
The community has helped me get this far with my VBA code - I'm trying to loop through a range C2:C3 (freehold and leasehold) and then return the value freehold or lease hold in column B next to the relevant keyword.
I'm completely stuck on why this isn't working and I would love a hand.
Here is the excel spreadsheet I'm using to test my macro on
Sub LoopRange()
Dim lastrow, i As Variant
lastrow = Range("A" & Rows.Count).End(xlUp).Row
Dim rCell As Range
Dim rRng As Range
Set rRng = Sheet1.Range("C2:C3")
For Each rCol In rRng.Columns
For Each rCell In rCol.Rows
Debug.Print rCell.Address, rCell.Value
Next rCell
Next rCol
For i = 2 To lastrow
If Range("A" & i).Value Like "*rCell.Value*" Or Range("A" & i).Value Like "*rCell.Value" Or Range("A" & i).Value Like "rCell.Value*" Then
Range("B" & i).Value = "rCell.Value"
End If
Next i
End Sub
There is usually another 20-40 terms just like freehold and leasehold - that is why I need to use a loop through sequence.
P.S. Thank you to those who already replied - you guys have been immensely helpful already and I can't wait to improve my skills and start giving back to this community
Current process of manually adding the keyword categorisation.
Thanks again I really appreciate it guys!