Capt_Antihero
New Member
- Joined
- Jun 16, 2014
- Messages
- 14
Hello,
I have 4 columns with data H, I, J and K. I need to write a macro that will search through H, starting at H14 and look for a single 0 (zero) in all cells with data in column H starting from H14. This is where I get a bit stuck as I don't know how to add IF functions through arrays.
So as example if H27 has a 0 and only a zero, I need it to check the cell next to it so offset check to I27, and if I27 has a single zero I need it to check J27 so offset again and if J27 has a single zero then I would like all those cells H27, I27, J27 and also the next offset K27 to interior colour yellow. Now because that isn't difficult enough for a novice like me, if all of the above rains true and H27:K27 are all yellow H27:J27 had a single zero in their cells, I would like the contents of K27 to copy to F12.
I know how to do this if I knew the location of the zeros but as my data could be 1000 rows and there could only be 1 row that has the single 0 (zero) in cells H, I and J I need to know how to look through my arrary of data and apply the if sequence / offset as above. If anyone can help me, then that would be amazing...?
I have 4 columns with data H, I, J and K. I need to write a macro that will search through H, starting at H14 and look for a single 0 (zero) in all cells with data in column H starting from H14. This is where I get a bit stuck as I don't know how to add IF functions through arrays.
So as example if H27 has a 0 and only a zero, I need it to check the cell next to it so offset check to I27, and if I27 has a single zero I need it to check J27 so offset again and if J27 has a single zero then I would like all those cells H27, I27, J27 and also the next offset K27 to interior colour yellow. Now because that isn't difficult enough for a novice like me, if all of the above rains true and H27:K27 are all yellow H27:J27 had a single zero in their cells, I would like the contents of K27 to copy to F12.
I know how to do this if I knew the location of the zeros but as my data could be 1000 rows and there could only be 1 row that has the single 0 (zero) in cells H, I and J I need to know how to look through my arrary of data and apply the if sequence / offset as above. If anyone can help me, then that would be amazing...?