VB Code help

  • Thread starter Christopher Anderson
  • Start date
C

Christopher Anderson

Here is a portion of one of my VB Macros in Excel:

If Selection.Count > 0 Then
MsgBox ("Average = ") & (RunningTotal / Selection.Count), vbInformation,
"Average"
End If

My question: How do I format the number (RunningTotal/Selection.Count) to
look like 0.000, instead of 0.0000000000000000?? What should my code look
like with the new formatting.

Thanks

Chris
 
E

Earl Kiosterud

Chris,

Try this:
....Format((RunningTotal / Selection.Count), "0.000")...
 
Top