Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I, I have this macro that look for a value between 2 numbers in column x and
the interpolate for a given value, the macro is: Sub inter() Dim Value Dim a, P As Integer Dim XRange As Range Dim YRange As Range Value = 5.5 'value given by the user (could be textbox1) a = 1 Set XRange = Range("a1:a600") Set YRange = Range("b1:b600") While a < XRange.Rows.Count If Value Cells(a, 1) And Value < Cells(a + 1, 1) Then P = a Xs = Array(.Index(XRange.Value2, P, 1), .Index(XRange.Value2, P + 1, 1)) Ys = Array(.Index(YRange.Value2, P, 1), .Index(YRange.Value2, P + 1, 1)) Interpolate = .Forecast(Value, Ys, Xs) MsgBox Interpolate Else a = a + 1 End If Wend End Sub I know that those .Index and .Forecast needs a "with" and "end with" but I don't know what kind of with (I thought With activeworksheet but it didn't work) so could someone tell me how to make my macro run???? TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hiding all cells that dont have any text | Excel Discussion (Misc queries) | |||
Kinda like a database - I cant believe others dont need to do th | Excel Discussion (Misc queries) | |||
I don´t view the value right after six decimal place in Excel | Excel Discussion (Misc queries) | |||
Dont want member number to repeat in the same column. | Excel Discussion (Misc queries) | |||
Don´t show Updatelinks prompt and don´t update | Excel Programming |