List 28 12 Q4: List of 25 Numbers Use Worksheet List in HW_1_X.xlsm file along w
ID: 3748088 • Letter: L
Question
List 28 12 Q4: List of 25 Numbers Use Worksheet List in HW_1_X.xlsm file along with the List module to solve this task. A user-defined VBA function should be written in the List module to find the maximum number 70 tto other arrangements of numbersS divisible by 4, minimum number divisible by 4, and the average of all numbers divisible by 4 in in the List The user-defined VBA function should fill up the table as follows the list. Ensure that the user-defined function is generalizable to other arrangements of numbers5 12 Maximum Average Minimum 28 3.36 4 42 24Explanation / Answer
Write this function in a module of your excel
Function maxmin(rng As Range)
Dim cell As Range
c = rng.Count
Dim arr1() As Integer
Dim ret() As Variant
ReDim ret(3)
ReDim arr1(c)
Dim i As Integer
i = 0
For Each cell In rng
'maxmin = maxmin + cell.Value
If cell.Value Mod 4 = 0 Then
arr1(i) = cell.Value
i = i + 1
End If
Next cell
maxmin = WorksheetFunction.Max(arr1)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.