Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all.
I'm trying to using a dropdown form menu to do some calculations that will access a function that has an array. Please look at my code and please point out what i'm doing wrong. Public Function Test(j As Integer) As Single Dim Check(20) As String Dim Result(20) As String Dim Upper(20) As Single Dim Lower(20) As Single Dim UL(20) As Single Dim LL(20) As Single Dim i, k, j As Integer k = 4 i = 0 j = 0 Do Until i = 20 Check(i) = Worksheets("Sheet1").Cells(k, 3) Upper(i) = Worksheets("Sheet1").Cells(k, 4) Lower(i) = Worksheets("Sheet1").Cells(k, 5) If Check(i) < "" Then Result(j) = Check(i) UL(j) = Upper(i) LL(j) = Lower(i) j = j + 1 End If i = i + 1 k = k + 1 Loop Test = UL(j) End Function Sub DropDown4_Change() If Range("f13") = 1 Then Application.ScreenUpdating = False Range("c1") = Test(1) Application.ScreenUpdating = True End If End Sub Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing an array in a user defined function | Excel Programming | |||
Passing array from Access to Excel function | Excel Programming | |||
Passing an array as argument for custom Function | Excel Programming | |||
Passing array of strings from DLL function to VBA | Excel Programming | |||
Passing array to a function | Excel Programming |