Moonbeam111
Board Regular
- Joined
- Sep 24, 2018
- Messages
- 73
- Office Version
- 365
- 2010
I am trying to figure this out. I have range("I22:I25"). In that range I would like to search for a particular set of words. Lets simply call them: "Example1", "Example2",and "Example3"
I am wanting to run a macro that looks for those words (example1, example2 etc....). And if it matches to subtract by 1 the number that is to the left of it. But only subtract if there is actually a number there, not if its a blank cell.
Might sound confusing but here is an example.
Macro will run. When it runs it will look for the words Example1, 2 or 3 in ColumnB. If it finds the word it then checks to the left of the cell in ColumnA and checks to see if its blank or not. If its not blank it will then subtract 1 from it.
So if I ran the macro right now. The finished result in ColumnA would be: stays empty, 2, stays empty.
I am wanting to run a macro that looks for those words (example1, example2 etc....). And if it matches to subtract by 1 the number that is to the left of it. But only subtract if there is actually a number there, not if its a blank cell.
Might sound confusing but here is an example.
Macro will run. When it runs it will look for the words Example1, 2 or 3 in ColumnB. If it finds the word it then checks to the left of the cell in ColumnA and checks to see if its blank or not. If its not blank it will then subtract 1 from it.
So if I ran the macro right now. The finished result in ColumnA would be: stays empty, 2, stays empty.
ColumnA | ColumnB |
Example1 | |
3 | Example2 |
Example3 |