+ Reply to Thread
Results 1 to 6 of 6

Thread: Number Format:Can you please help how to do this?

  1. #1
    Registered User
    Join Date
    11-12-2008
    Location
    London
    Posts
    6

    Number Format:Can you please help how to do this?

    Hi all

    I'm trying to change the format of numbers in a log-scale chart so that they appear as 10^x e.g. 10^3 rather than 1000 or 1E+03 or 1E+3..etc as in this image
    http://img135.imageshack.us/img135/7403/picfm9.jpg
    http://img135.imageshack.us/img135/p...jpg/1/w847.png

    Can you please help how to do this?

    Warm thanks

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,349
    You will need to create you own axis labels and then use code to format them.
    Note that Log axis will not allow zero or negative values.

    Sub SuperScriptDLabels()
    
        Dim objDlabel As DataLabel
        Dim lngIndex As Long
        
        With ActiveChart
            For lngIndex = 2 To 3
                For Each objDlabel In .SeriesCollection(lngIndex).DataLabels
                    With objDlabel
                        .AutoText = False
                        .Text = .Text
                        .Characters(3, 1).Font.Superscript = True
                    End With
                Next
            Next
        End With
        
    End Sub
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-12-2008
    Location
    London
    Posts
    6
    Quote Originally Posted by Andy Pope View Post
    You will need to create you own axis labels and then use code to format them.
    Note that Log axis will not allow zero or negative values.

    [/code]

    Thank you so much for your help, appreciated

    Could you please tell me a little bit about how can I create my own code and formatting the axis, since I'm very new in this stuff.. All I do-usually- is use Excel functions..

    Also, when I change the cells location in the attached file, the data points and axis scale change as well, is there a way to control this?

    Warm thanks

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,349
    Well the code should handle most situations so not sure what you want in terms of 'your own code'.

    Need more detail on what you mean by cell locations changing.

    Do you need help on how to add the 2 extra series and format the axis to not display built-in values?
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    11-12-2008
    Location
    London
    Posts
    6
    Quote Originally Posted by Andy Pope View Post
    Well the code should handle most situations so not sure what you want in terms of 'your own code'.

    Need more detail on what you mean by cell locations changing.

    Do you need help on how to add the 2 extra series and format the axis to not display built-in values?
    I think I figured out how to change the labels..... just a quick question, how do I use the macro in Excel like the one you wrote?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,349
    Open the workbook.
    ALT+F11 (opens VBE [Visual Basic Editor])
    Insert Module in to project
    Paste code into module
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0