11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

752<br />

Part VII: Appendixes<br />

Displaying a number format string in a cell<br />

Excel doesn’t have a worksheet function that displays the number format for a specified cell.<br />

You can, however, create your own function using VBA. Insert the following function procedure<br />

into a VBA module:<br />

Function NumberFormat(cell) As String<br />

‘ Returns the number format string for a cell<br />

Application.Volatile True<br />

NumberFormat = cell.Range(“A1”).NumberFormat<br />

End Function<br />

Then you can create a formula such as the following:<br />

=NumberFormat(C4)<br />

This formula returns the number format for cell C4. If you change a number format, use<br />

Ctrl+Alt+F9 to force the function to be reevaluated.<br />

Displaying leading dots<br />

The following custom number format is a variation on the accounting format. Using this number<br />

format displays the dollar sign on the left and the value on the right. The space in between is<br />

filled with dots.<br />

($*.#,##0.00_);_($*.(#,##0.00);_($* “-”??_);_(@_)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!