+ Reply to Thread
Results 1 to 4 of 4

Thread: 3D chart rotation buttons Excel 2007

  1. #1
    Registered User
    Join Date
    12-11-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Lightbulb 3D chart rotation buttons Excel 2007

    Hello all & festive greetings to all,

    Goal: I am trying to put two arrow buttons with a 3D chart (3D area chart) that will rotate the chart left and right.

    Issue:I understand that in Excel 2007 recording macros only goes so far, and cannot help in this instance.
    The problem i am having is that i cannot record macros and I am not a vba user.
    I can easily adjust the view by right clicking on the chart and using the 3D options, but that is not an optimum solution.
    I tried adding the 3D button to the ribbon and record a macro to it that way, but that didn't work.

    Advanced thankyou: I'd be really grateful if anyone could provide a solution (or a link to a working example) that I could use.

    Kind Regards,

    GM
    (boing!)
    Last edited by Guru Meditation; 12-23-2011 at 07:44 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: 3D chart rotation buttons Excel 2007

    The example file has 4 shapes using this macro.

    Sub RotateChart()
    
        Dim chtTemp As Chart
        Set chtTemp = ActiveSheet.Shapes("Chart 1").Chart
        
        Select Case UCase(Application.Caller)
        Case "RIGHT ARROW 4"
            chtTemp.PlotArea.Format.ThreeD.RotationX = chtTemp.PlotArea.Format.ThreeD.RotationX - 1
        Case "RIGHT ARROW 2"
            chtTemp.PlotArea.Format.ThreeD.RotationX = chtTemp.PlotArea.Format.ThreeD.RotationX + 1
        Case "RIGHT ARROW 3"
            chtTemp.PlotArea.Format.ThreeD.RotationY = chtTemp.PlotArea.Format.ThreeD.RotationY - 1
        Case "RIGHT ARROW 5"
            chtTemp.PlotArea.Format.ThreeD.RotationY = chtTemp.PlotArea.Format.ThreeD.RotationY + 1
        End Select
    
    End Sub
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-11-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: 3D chart rotation buttons Excel 2007

    thanks so much Andy! I'll give it a try - VERY much appreciated!

    G M
    (boing!)

  4. #4
    Registered User
    Join Date
    12-11-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: 3D chart rotation buttons Excel 2007

    Hi,
    (and happy new year everyone)
    I tried using your macro code, but no luck I'm afraid - I can see what it's supposed to do, but i wasn't able to create
    a 3D chart with buttons that worked to rotate the view despite all your kind help.
    I'm just wondering if you or your colleagues might be able to point me in the direction of a complete example that I can copy/paste/tweak as necessary?
    Apologies in advance if I've missed the blooming obvious...

    Kind Regards,

    G M

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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