LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default need help with array

I have written the following in a module.

Private Function Test(j As Integer) As Single
Dim Check(20) As Variant
Dim ULTemp(20) As Single
Dim LLTemp(20) As Single
Dim UL(20) As Single
Dim LL(20) As Single
Dim i, k As Integer
k = 4
i = 0
j = 0
Do Until i = 20
Check(i) = Worksheets("Sheet1").Cells(k, 3)
ULTemp(i) = Worksheets("Sheet1").Cells(k, 4)
LLTemp(i) = Worksheets("Sheet1").Cells(k, 5)

If Check(i) < "" Then
UL(j) = ULTemp(i)
LL(j) = LLTemp(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
Cells(1, 1) = Test(1)

Application.ScreenUpdating = True
End If
End Sub

the user get to select one of many options from the dropdown form on
sheet 2.

once the user select one of the options it will then triger the Test
function to scan a few columns from sheet 1 and omit the empty rows and
only keep the rows with # into an array.

I want to be able to access the saved data in the array and do some
calculation on it.

But when ever option 1 is chosen it returned a value of 0 everytime.

any suggestion to what I might be doing wrong?

Thanks.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"