Public Sub lowerstNSW()
Dim x, Rng1
Dim excel As New Microsoft.Office.Interop.Excel.Application
Rng1 = Globals.Sheet1.Range("E16:E30")
x = excel.Min(Rng1)
If x = 0 Then
x = excel.Evaluate("=MIN(IF(" _
& Rng1.Address & ">0," _
& Rng1.Address & "))")
End If
Globals.Sheet1.Range("K2").Value = x
End Sub
ASKER
ASKER
Public Sub lowerstNSW()
Dim x As Double
Dim Rng1 As Range
Set Rng1 = Range("E16:E30")
x = Excel.Evaluate("=MIN(IF(" _
& Rng1.Address & ">0," _
& Rng1.Address & "))")
Sheet1.Range("K2").Value = x
End Sub
ASKER
Public Sub lowerstNSW()
Dim x As Double
Dim Rng1 As Range
Set Rng1 = Range("E16:E30")
Range("K2").FormulaArray = "=MIN(IF(" & _
Rng1.Address & ">0," & Rng1.Address & "))"
End Sub
ASKER
ASKER
ASKER
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
TRUSTED BY
Open in new window