Consulting

Results 1 to 2 of 2

Thread: Sleeper: Numberformat, in^3 vs in?

  1. #1

    Sleeper: Numberformat, in^3 vs in?

    Selection.NumberFormat = "#.0## ""in?"""

    I use the above formatting to format the cell to show square inches or inch to the second power. I also use a similar one for cubic inches. These are easy since the squared (?) and cubed (?) are available using alt+0178 or alt+0179. This keeps the cell as a number and usable. If I were to place the text in the cell with the number, the cell would become a string and I do not want that.

    I need one for inch to the 4th. I do not like the in^4 that would show it.

    Is there using ONLY NumberFormat using a superscript 4?
    Selection.NumberFormat = "#.0## ""in(superscript 4)"""

    Thanks for the help.

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Well I thought this might help

    Selection.NumberFormat = "#.0## ""in4"""
        Selection.Characters(Len(Selection.Text), 1).Font.Superscript = True
    but it doesn't appear to work on cells that are not in text format.
    I suppose I shouldn't be surprised since the characters object "Represents characters in an object that contains text". You need your cell to contain a number (even though it still has a text property) so I don't think this is do-able
    K :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •