May 02 2022 05:15 AM - edited May 02 2022 05:16 AM
Hello Everyone,
Here is a question :
1 >> Highest Multiple of 2 that is <= the minimum value of "B" column..??
2 >> Lowest Multiple of 3 that is <= the minimum value of "D" column..??
Please help ..??
Here is a attached file..
I am using Microsoft Office 2019 Home and student version...
May 02 2022 06:34 AM
Sub large()
Dim i As Integer
Dim j As Integer
i = Application.WorksheetFunction.Min(Range(Cells(2, 5), Cells(11, 5)))
For j = i To i + 2
If j Mod 3 = 0 Then
Cells(16, 9) = j
Else
End If
Next j
End Sub
Sub small()
Dim i As Integer
Dim j As Integer
i = Application.WorksheetFunction.Min(Range(Cells(2, 3), Cells(11, 3)))
For j = i To i - 1 Step -1
If j Mod 2 = 0 Then
Cells(14, 9) = j
Else
End If
Next j
End Sub
Maybe with these lines of code. In the attached file you can click the buttons in cells K14 and K16 to start the macros.