D
D.S.
Can VBA code be used to return the average of a worksheet selection? I'd
like to code a userform textbox to return this average.
D.S.
like to code a userform textbox to return this average.
D.S.
loaded.J.E. McGimpsey said:one way:
With UserForm1
On Error Resume Next
.TextBox1.Text = Application.Average(Selection)
If Err Then _
.TextBox1.Text = "Invalid Selection" 'or perhaps zero
On Error GoTo 0
.Show
End With
loaded.J.E. McGimpsey said:one way:
With UserForm1
On Error Resume Next
.TextBox1.Text = Application.Average(Selection)
If Err Then _
.TextBox1.Text = "Invalid Selection" 'or perhaps zero
On Error GoTo 0
.Show
End With