SUSAN BAXTER
New Member
- Joined
- Apr 1, 2019
- Messages
- 47
I was looking for help on creating some code to find numbers 1 to 20.
The code would search for any numbers 1 to 20, in the ranges E3:E10, F10:F17, H3:H10 (I will need to be able to add additional ranges in the future). A positive result ones that have data in the cell to the right of it (see my example below). When the code has a positive result it would perform a count and write the total results to cell B18.
All cells have numbers in them but most do NOT have any data in the cell to the right of it. The set of number cells are formatted as general.
That would do it. Thanks so much for all your help.
(Cell B18 below)
3
Cell ranges below:
E3
E4
E5 1, cell E6 has 1-1 in it
E6
E7
E8
E9
E10
F10
F11
F12
F13
F14
F15 2, cell F16 has 9-9 in it
F16
F17
H3 20, cell H4 has 20-1 in it
H4
H5
H6
H7
H8
H9
H10
In my above sample data the code would find 3 cells with sets of numbers in the cells to the right of it. First in cell E5 (number 1 with a 1-1 in cell E6), second cell F15 (number 2 with a 9-9 in cell F16) and third H3 (20 with a 20-1 in cell H4). The code would then add up the 3 positive results and write the count 3 to cell B18.
Thanks so much.
<style type="text/css">p { margin-bottom: 0.25cm; direction: ltr; color: rgb(0, 0, 0); line-height: 115%; text-align: left; }p.western { font-family: "Liberation Serif", serif; font-size: 12pt; }p.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }p.ctl { font-family: "Lohit Devanagari"; font-size: 12pt; }a:link { }</style>
The code would search for any numbers 1 to 20, in the ranges E3:E10, F10:F17, H3:H10 (I will need to be able to add additional ranges in the future). A positive result ones that have data in the cell to the right of it (see my example below). When the code has a positive result it would perform a count and write the total results to cell B18.
All cells have numbers in them but most do NOT have any data in the cell to the right of it. The set of number cells are formatted as general.
That would do it. Thanks so much for all your help.
(Cell B18 below)
3
Cell ranges below:
E3
E4
E5 1, cell E6 has 1-1 in it
E6
E7
E8
E9
E10
F10
F11
F12
F13
F14
F15 2, cell F16 has 9-9 in it
F16
F17
H3 20, cell H4 has 20-1 in it
H4
H5
H6
H7
H8
H9
H10
In my above sample data the code would find 3 cells with sets of numbers in the cells to the right of it. First in cell E5 (number 1 with a 1-1 in cell E6), second cell F15 (number 2 with a 9-9 in cell F16) and third H3 (20 with a 20-1 in cell H4). The code would then add up the 3 positive results and write the count 3 to cell B18.
Thanks so much.
<style type="text/css">p { margin-bottom: 0.25cm; direction: ltr; color: rgb(0, 0, 0); line-height: 115%; text-align: left; }p.western { font-family: "Liberation Serif", serif; font-size: 12pt; }p.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }p.ctl { font-family: "Lohit Devanagari"; font-size: 12pt; }a:link { }</style>