And this is a vba solution.
- It accepts a looser syntax, with possible spaces between the numbers and the signs, ex. "2-4", "2 -4", "2 - 4", "11 +"
- the rows/columns can be defined with just one number (like in the example I post in the columns' headers there's a cell with just 26).
Hope this helps
PGC
<table border="1" cellpadding="1" style="background:#FFF; border-collapse:collapse;border-width:2px;border-color:#CCCCCC;font-family:Arial,Arial; font-size:10pt" ><tr><th style="border-width:1px;border-color:#888888;background:#9CF " > </tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >A</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >B</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >C</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >D</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >E</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >F</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >G</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >H</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >I</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >J</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >K</tr><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >L</tr></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
3</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
4</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >Val_02</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
5</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >20 - 25</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >26</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >27- 30</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
6</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >Val_01</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >0-5</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >101</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >102</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >103</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
7</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >6 -10</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >104</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >105</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >106</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
8</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >11 +</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >107</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >108</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >109</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
9</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
10</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
11</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
12</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >Val_01</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >1</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >5</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >7</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >9</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >11</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >8</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >13</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >0</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >15</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
13</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >Val_02</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >20</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >26</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >29</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >26</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >30</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >22</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >26</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >27</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >25</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
14</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:left" style="border-width: 1px;border-color:#888888" >Result</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >101</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >102</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >106</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >105</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >109</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >104</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >108</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >103</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" >107</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF; text-align:center" >
15</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:right" style="border-width: 1px;border-color:#888888" > </td></tr><tr><td colspan=13 style="background:#9CF; padding-left:1em" > [Book1]Sheet1</td></tr></table>
<table border="1" cellpadding="1" style="background:#FFF; border-collapse:collapse;border-width:2px;border-color:#CCCCCC;font-family:Arial,Arial; font-size:10pt" ><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF " >Addr</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF " >Formula</td></tr><tr><td colspan=2 style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="background:#9CF " >[Book1]Sheet1</td></tr><tr><td rowspan=2 style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" style="text-align:center" >C14</td><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" > =RangesGetValue($C$5:$F$8,C12,C13) </td></tr><tr><td style="border-width:1px;border-color:#888888; padding-left:0.5em; padding-top:0.25em; padding-right:0.5em; padding-bottom:0.25em" > Copy accross</td></tr></table>
Code:
Function RangesGetValue(rTable As Range, lTableRow As Long, lTableColumn As Long)
Dim lRow As Long, lColumn As Long
lRow = GetCoordinate(rTable.Columns(1).Resize(rTable.Rows.Count - 1).Offset(1).Cells, lTableRow, True)
lColumn = GetCoordinate(rTable.Rows(1).Resize(1, rTable.Columns.Count - 1).Offset(, 1).Cells, lTableColumn, False)
RangesGetValue = Cells(lRow, lColumn)
End Function
Function GetCoordinate(rVal_Headers As Range, lVal As Long, bRow As Boolean)
Dim rCell As Range, oMatch As Object
With CreateObject("vbscript.regexp")
.Pattern = "^(\s*(\d+)\s*|\s*(\d+)\s*\-\s*(\d+)\s*|\s*(\d+)\s*\+\s*)$"
On Error Resume Next
For Each rCell In rVal_Headers
Set oMatch = .Execute(rCell.Value)(0)
If Err > 0 Then
Err.Clear
Else
If (oMatch.submatches(1) = lVal) Or _
((oMatch.submatches(2) <> "") And (oMatch.submatches(2) <= lVal) And (oMatch.submatches(3) >= lVal)) Or _
((oMatch.submatches(4) <> "") And (oMatch.submatches(4) <= lVal)) Then
GetCoordinate = IIf(bRow, rCell.Row, rCell.Column)
Exit For
End If
End If
Next rCell
End With
End Function