Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I am trying to write a subroutine where A is the array of temperature data lenght is the number of temperature records to be searched and MIN and Max to return the values i want to rite a sub routine to returnt he largest and smallest value of an array of an given length ive starting with a calling line which is CALL BigLittle(A,Length,Max,Min) any help would be greAT what do pass by adress and pass by value mean?? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
With no validation...
Option Explicit Sub testme() Dim myBigArray() As Double Dim myMaximum As Double Dim myMinimum As Double Dim myLength As Long Dim iCtr As Long ReDim myBigArray(5 To 35) For iCtr = LBound(myBigArray) To UBound(myBigArray) 'some testdate myBigArray(iCtr) = iCtr / 100 Next iCtr myLength = 5 Call BigLittle(myBigArray, myLength, myMaximum, myMinimum) MsgBox myMaximum & vbLf & myMinimum End Sub Sub BigLittle(myArr() As Double, myLen As Long, _ myMax As Double, myMin As Double) Dim myLittleArr() As Double Dim iCtr As Long ReDim myLittleArr(LBound(myArr) To LBound(myArr) + myLen) For iCtr = LBound(myLittleArr) To UBound(myLittleArr) myLittleArr(iCtr) = myArr(iCtr) Next iCtr With Application myMax = .Max(myLittleArr) myMin = .Min(myLittleArr) End With End Sub biker man wrote: I am trying to write a subroutine where A is the array of temperature data lenght is the number of temperature records to be searched and MIN and Max to return the values i want to rite a sub routine to returnt he largest and smallest value of an array of an given length ive starting with a calling line which is CALL BigLittle(A,Length,Max,Min) any help would be greAT what do pass by adress and pass by value mean?? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to use this subroutine on multiple cells? | Excel Worksheet Functions | |||
Worksheet Cell Range Name within VB Subroutine | Excel Discussion (Misc queries) | |||
How do I exit a macro subroutine? | Excel Worksheet Functions | |||
Breakpoint will not stop Excel subroutine | Excel Discussion (Misc queries) | |||
How to pass a workshhet name as a parameter into a subroutine ? | Excel Discussion (Misc queries) |