VB Code help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Chris,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top