How to store values in excel using macro ?

Joined
Oct 8, 2013
Messages
3
Reaction score
0
Hello there,
i'm new to excel..

i need Help in macros in excel

i want to know how to store the values using macros in excel . ?

as shown in table below,, the value of K vary as a/b vary. i want to write a macro such that the "a" and "b" values are entered in excel,the corresponding value of K should be taken by excel and shown in a specific box in excel sheet.

plz help


the table is as shown


a/b ----- 0.1 0.2 0.3 0.4 0.8 0.9 1.1 1.4 1.6 1.8 2

K-------- 4 4.2 4.4 4.8 5 5.5 5.6 5.8 5.9 6 6
 
try:
2013-10-08_223848.webp

(click on the thumb to enlarge)
 
Thank you p45cal ..
but is it possible to formula like this ?

If x <= 0 .1 Then
c = 4
ElseIf x <= 0.2 And x > 0.1 Then
c = 4.2
Else
c = 4.4
End If
 
does:
Code:
Sub blah()
x = 0.15
c = Evaluate("INDEX({4,4.2,4.4,4.8,5,5.5,5.6,5.8,5.9,6,6},MATCH(" & x & ",{0,0.1,0.2,0.3,0.4,0.8,0.9,1.1,1.4,1.6,1.8}))")
'alternatively:
'c = Application.Index(Array(4, 4.2, 4.4, 4.8, 5, 5.5, 5.6, 5.8, 5.9, 6, 6), Application.Match(x, Array(0, 0.1, 0.2, 0.3, 0.4, 0.8, 0.9, 1.1, 1.4, 1.6, 1.8)))
End Sub
give the correct results?
 
Back
Top