View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bryan Hessey[_2_] Bryan Hessey[_2_] is offline
external usenet poster
 
Posts: 1
Default Macro that runs entered value through "low" and "high" range


The easy way is to use the Low value and Code columns only, say A1 to
A10 has 0,6,11,16,21,26,31,36,41,46 and column B contains the relevant
code, and assuming that your data started in A20, the vlookup would be

=VLOOKUP(A20,$A$1:$B$10,2,TRUE)

which can be formula-dragged down the B column from B20 onwards.

Hope this helps.


Vika.F Wrote:
Is there a way to write a macro that can take the entered value from the
cells A2-A10 and run it through the "low" and "high" range and
automatically enter the correct codes to cells B2-B10 in the data
sheet.

code low high
1 0 5
2 6 10
3 11 15
4 16 20
5 21 25
6 16 30
7 31 35
8 36 40
9 41 45
10 46 50
11 51 55

For Example:
A B
7 2
3 1
53 11
42 9
32 7
53 11
14 3
28 6
5 1

Thank you very much for any help



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=395530