Hello,
I'm trying to write a macro to save me a huge amount of time at work. My VBA knowledge, however, is all self taught (over the last week), and somewhat limited.
The macro needs to check A2:A458 for every instance of the string: "word2". Upon finding a cell containing "word2" I want it to count the number of cells above it until it identifies a cell containing the string: "word1". This number (e.g. if word1 is 3 cells above word2, then the number is 3) is then compared to a table of ten possible values (1-10). At this point I intend to write an if statement indicating what happens for each of the 10 possible values. So, if 3, then I would add 2,250,000 microseconds to a time in a separate sheet.
I believe I've figured out most of the code, but I can't find a way to count the distance between "word2" and "word1". If I can get this macro to work, it will save me weeks of work, so I would be grateful for any and all help. This is also my first time using this forum, so please forgive any faux pas I may have committed.
Thanks,
Ben
I'm trying to write a macro to save me a huge amount of time at work. My VBA knowledge, however, is all self taught (over the last week), and somewhat limited.
The macro needs to check A2:A458 for every instance of the string: "word2". Upon finding a cell containing "word2" I want it to count the number of cells above it until it identifies a cell containing the string: "word1". This number (e.g. if word1 is 3 cells above word2, then the number is 3) is then compared to a table of ten possible values (1-10). At this point I intend to write an if statement indicating what happens for each of the 10 possible values. So, if 3, then I would add 2,250,000 microseconds to a time in a separate sheet.
I believe I've figured out most of the code, but I can't find a way to count the distance between "word2" and "word1". If I can get this macro to work, it will save me weeks of work, so I would be grateful for any and all help. This is also my first time using this forum, so please forgive any faux pas I may have committed.
Thanks,
Ben