Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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 |
#2
![]() |
|||
|
|||
![]()
Chris,
Try this: ....Format((RunningTotal / Selection.Count), "0.000")... -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Christopher Anderson" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code not working and can't see why | Excel Discussion (Misc queries) | |||
Often-Used Code not working in a new Workbook | Excel Discussion (Misc queries) | |||
how can i select all the cells with same color on a sheet if there are multipale colors by vba code | Charts and Charting in Excel | |||
Problem with Date format from VBA code | Excel Discussion (Misc queries) | |||
Problem Code: Retrieving Stored Access 03 Query | Excel Discussion (Misc queries) |