Cell Number Format

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

Is there a way to format a cell's number from 1.2 to 1,200,000? I
know how to format millions to ones but how do I convert from ones to
millions? (I don't want to have to multiply in another cell).

Thanks!!!
 
I could be wrong but, suspect there is no way to achieve what you want using
format.

You could use the sheet change event to multiply numbers entered by one
million and format the result as you wish using code below. Just right-click
on the tab of the appropriate worksheet, click view code and paste. Note.
this will multiply value in column C only. You will need to modify to make
it work on the range you wish.


--
Steve


' *******************************************

Private Sub Worksheet_Change(ByVal Target As Range)



On Error GoTo Worksheet_Change_Error

Set isect = Application.Intersect(Target, Range("C:C"))
' C:C refers to column C
' change this to reference a different range
If isect Is Nothing Then
'do nothing
Exit Sub
Else
If Target.Value < 100000 Then
Target.Value = Target.Value * 1000000
End If

End If


On Error GoTo 0
Exit Sub

Worksheet_Change_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Worksheet_Change of VBA Document Sheet1"

End Sub

' *******************************************
 

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

Similar Threads

Excel Conditional Formatting 1
Date formatting 4
Mutiply in a range of cells ? 1
nested "if" formula problem. 5
Formatting a decimal representation of millions 3
CONDITIONAL FORMATTING QUERY 0
convert text to values 7
format 9

Back
Top