K
Ksenija
Hi,
does someone have an idea why I can't run WorksheetFunction?? I have a code
as below, but I get errormessages for WorksheetFunctions..
Sub prov()
For Each c In MyRange
If c.Interior.ColorIndex = 3 Then
If myrange1 Is Nothing Then
Set myrange1 = c
Else
Set myrange1 = Union(myrange1, c)
End If
End If
redaverage = WorksheetFunction.Average(myrange1)
maxvalue = WorksheetFunction.max(myrange1)
medianvalue = WorksheetFunction.Median(myrange1)
Next
End Sub
does someone have an idea why I can't run WorksheetFunction?? I have a code
as below, but I get errormessages for WorksheetFunctions..
Sub prov()
For Each c In MyRange
If c.Interior.ColorIndex = 3 Then
If myrange1 Is Nothing Then
Set myrange1 = c
Else
Set myrange1 = Union(myrange1, c)
End If
End If
redaverage = WorksheetFunction.Average(myrange1)
maxvalue = WorksheetFunction.max(myrange1)
medianvalue = WorksheetFunction.Median(myrange1)
Next
End Sub