You can't use Format Cells to format the decimal point away, so you will
need to use VB code to accomplish what you want. Here is some event code
that will allow you to toggle the column with your values in it back and
forth between the currency and your 10-digit leading zeroes format. I used
the BeforeRightClick event for the toggle mechanism... just click into your
column and right click the mouse. You will set the column by changing the
number 3 I used in the Const statement to whatever column number you need it
to be. To implement this event procedure, right click the tab for the
worksheet containing your values and copy/paste the code below into the code
window that appeared.
Rick
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
Dim X As Long
Dim LastRow As Long
Const Col As Long = 3
If Target.Column = Col Then
Cancel = True
LastRow = Cells(Rows.Count, Col).End(xlUp).Row
For X = 1 To LastRow
With Cells(X, Col)
If InStr(.Value, ".") > 0 Then
.Value = 100 * .Value
.NumberFormat = "0000000000"
Else
.Value = .Value / 100
.NumberFormat = "$###0.00"
End If
End With
Next
End If
End Sub
"right justified and zero filled (excel)" <right justified and zero filled
(excel)@discussions.microsoft.com> wrote in message
news:
[email protected]...