Rotation of 3D surface

szymagic

Board Regular
Joined
Jul 8, 2016
Messages
61
Hello all,

I seem to be having an issue with rotating a 3D surface.

I have an grid of elevation values that I have plotted to a 3D surface.
I want to be able to use 2 ActiveX spin buttons to rotate the surface in the X and Y planes, in order to get a better look at the surface elevations.

This is the code I have thus far:

Code:
Private Sub SpinButton1_Change()Dim i As Variant


i = SpinButton1.Value


ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
    With ActiveChart
        .Rotation = i 'this rotates in the X plane
        .Refresh
    End With
Range("A1").Select
    
End Sub

This will rotate the chart in the X plane whenever I change the Spin Button.. I can't for the life of me figure out how to get the rotation is Y plane.

I've tried using the ThreeD.RotationY method but I haven't been able to get that to work either
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,215,664
Messages
6,126,101
Members
449,292
Latest member
Mario BR

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top