I have some code that searches a range and does a count of the values and writes the results to cell A18.
I need to make a change to the code to search the ranges but look for values over 25 and write the results to cells B3, B4, B5 or B6. Some ranges may or may not have sets of numbers in them. I’m only interested in sets of numbers that have a value of 26 (2nd number in set) or higher in them. An example would be 8-26 or 7-35. Below is sample data and when I’m finished designing my sheet it will have data above, below the search ranges. See example below with expected result.![]()
Please Login or Register to view this content.
General Notes:
- I can not use a formula because their are issues with some other VBA code I run in the same cell range.
- I need hard code for the search ranges (I have many ranges in different locations on the sheet) so I can add or delete in the code.
- The sheet name is Sheet 1 and their is only one sheet in the workbook.
- Using Excel 2007.
- The search range cells are formatted as text.
- The write cells are formatted as general.
Sample data:
The code searches ranges D3:D12, F3:F12, H3:H12 for sets of numbers that are over 26 or higher. The first found set of numbers would be 10-26 in cell E9 and the 2nnd positive set of numbers would be 5-35 located in cell F10. The code would then write the cell location to cells B3, B4, B5 or B6. If their are NO positive results could the code write a 0 in each of the four cells.
If you have any questions please ask so I can clarify any issue(s). Thanks so much for all your help.
Bookmarks