I'm not exactly sure what format you're wanting, so here's several.
If your wanting to display "10^6" exactly liek that, and you don't need it
for a calculation, try putting an apostrophe in front of it to tell Excel
that you want to display exactly as you write.
'10^6
If you need to use in calculation, try formatting the cell to scientific.
YOu can then set how many decimal places you want.
Thank you. I should have been more explicit.
I need to show, ten to the power of 6 with the number six as
superscript. I was able to show 10³ but not the other one. It always
defaults to 106.
Type '106' into the cell, then select the '6' and superscript it.
Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------
Thank you. I should have been more explicit.
I need to show, ten to the power of 6 with the number six as
superscript. I was able to show 10³ but not the other one. It always
defaults to 106.
Unfortunately 6 has no ascii code to show it as superscript as 2 and 3 have like
Alt + 0178 or 0179
You could use event code to superscript the numbers.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
If .Value <> "" Then
.NumberFormat = "@"
.Characters(Start:=(Len(Target)), Length:=1).Font.Superscript = True
End If
End With
ErrHandler:
Application.EnableEvents = True
End Sub
As written the code works only on column A.
This is event code. Right-click on the sheet tab and "View Code".
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.