It is not possible to do this with a direct Custom Cell Format; however, we can create a Custom Cell Format in VBA event code that will do what you asked for.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Long, Txt As String, Cell As Range
If Not Intersect(Columns("[B][COLOR=#FF0000]C[/COLOR][/B]"), Target) Is Nothing Then
For Each Cell In Intersect(Columns("[B][COLOR=#FF0000]C[/COLOR][/B]"), Target)
Txt = Cell.Value
For X = 1 To Len(Txt)
If Mid(Txt, X, 1) Like "#" Then Mid(Txt, X) = "0"
Next
Cell.NumberFormat = Txt & "\*" & Cell.Value
Next
End If
End Sub
NOTE: You did not tell us what column you would be entering numbers into, so I guessed at Column C. If that is incorrect, change the red highlighted column letters to the correct column reference.
HOW TO INSTALL Event Code
------------------------------------
If you are new to event code procedures, they are easy to install. To install it, right-click the name tab at the bottom of the worksheet that is to have the functionality to be provided by the event code and select "View Code" from the popup menu that appears. This will open up the code window for that worksheet. Copy/Paste the event code into that code window. That's it... the code will now operate automatically when its particular event procedure is raised by an action you take on the worksheet itself. Note... if you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.