Hi,
I am trying to automate a process using VBA. Please help to find errors in my logic.
I have a Sheet1 that contains the descriptions of over 10,000 different vehicles. I have to Search those descriptions in sheet 1 and map to the corresponding vehicle… I have another sheet with the list of vehicles.
I have column A, B, C and D in a lookup sheet2.
Column A has the list of all vehicle types like car,bus, train etc which should be mapped to a description in sheet1.
Column B and C – has Search keywords that should be found in the description
Column D – has Search keywords that should not be found in the description
Column B is mandatory. Whereas Column C and D are optional and they can hold additional information to help select the appropriate vehicle name from the Column A when I search the descriptions.
It is working and I think it works fine, but I am not sure if it is 100% correct. I am not sure if this is the best way to do it.
Help me to possibly find any errors in my code.
ColA SearchWord1(found) SearchWord2(found) Search Word 3(not found)
Ferrari Ferrari car horse
Mclaren Mclaren car engine
train train
bus Bus public transport
So, when I search in a description, if I see Ferrari and car and it does not have horse in it, then I will identify it as "Ferrari"
-when I search in a description, if I see Mclaren and car and it does not have engine in it, then I will identify it as "Mclaren"
-when I search in a description, if I it has train, then I will identify it as "train"
-when I search in a description, if I see bus and public transport, then I will identify it as "bus"
So, the first keyword is mandatory.. 2nd and 3rd keyword are optional. 2nd keyword should be found in the desc and 3rd keyword should not be found in the desc
Here is my code.
Bookmarks