All,
I'm using Excel 2007 and I have a reasonable level of experience with VBA coding in normal / object modules, but I have no experience with class modules or events ... so I do not have a good command on what goes into a normal module vice a class module if I want to use mouse events to rotate a chart.
I am looking to rotate a chart ... Since I am not allowed to post a file, I will give the 3D array here:
<tbody>
</tbody>
I have placed into a normal module the following code (based on what I was able to pick up from MSDN):
And I have placed the following code into a class module named EventClassModule (also based on what I was able to pick up from MSDN):
I want to rotate the chart by using click and drag, and, if possible, I'd also like to be able to zoom in and out via some method (say a mouse wheel event).
In the following link, a guy named Gabor Doka has done a beautiful job of enabling scatter plot rotation using scroll bars, but I'd like to be able to use mouse events instead:
3d scatter plot for MS Excel (VBA macro)
Please help! Thanks, and I hope to hear from someone
Justin
I'm using Excel 2007 and I have a reasonable level of experience with VBA coding in normal / object modules, but I have no experience with class modules or events ... so I do not have a good command on what goes into a normal module vice a class module if I want to use mouse events to rotate a chart.
I am looking to rotate a chart ... Since I am not allowed to post a file, I will give the 3D array here:
1.0000 | 2.0000 | 3.0000 | 4.0000 | 5.0000 | 6.0000 | 7.0000 | 8.0000 | |
1.0000 | 0.0571 | 0.0629 | 0.0691 | 0.0761 | 0.0837 | 0.0885 | 0.3353 | 0.2794 |
2.0000 | 0.0800 | 0.0880 | 0.0968 | 0.1065 | 0.1171 | 0.1416 | 0.3688 | 0.3074 |
3.0000 | 0.1120 | 0.1232 | 0.1355 | 0.1491 | 0.1640 | 0.2266 | 0.4057 | 0.3381 |
4.0000 | 0.1568 | 0.1725 | 0.1897 | 0.2087 | 0.2296 | 0.3625 | 0.4463 | 0.3719 |
5.0000 | 0.2195 | 0.2415 | 0.2656 | 0.2922 | 0.3214 | 0.5800 | 0.4909 | 0.4091 |
6.0000 | 0.3074 | 0.3381 | 0.3719 | 0.4091 | 0.4500 | 0.6000 | 0.5400 | 0.4500 |
7.0000 | 0.2937 | 0.3231 | 0.3554 | 0.3909 | 0.4300 | 0.5900 | 0.4500 | 0.3750 |
8.0000 | 0.2670 | 0.2937 | 0.3231 | 0.3554 | 0.3909 | 0.5364 | 0.3462 | 0.2885 |
9.0000 | 0.2427 | 0.2670 | 0.2937 | 0.3231 | 0.3554 | 0.4876 | 0.2663 | 0.2219 |
10.0000 | 0.2207 | 0.2427 | 0.2670 | 0.2937 | 0.3231 | 0.4433 | 0.2048 | 0.1707 |
11.0000 | 0.2006 | 0.2207 | 0.2427 | 0.2670 | 0.2937 | 0.4030 | 0.1576 | 0.1313 |
12.0000 | 0.1824 | 0.2006 | 0.2207 | 0.2427 | 0.2670 | 0.3663 | 0.1212 | 0.1010 |
13.0000 | 0.1658 | 0.1824 | 0.2006 | 0.2207 | 0.2427 | 0.3330 | 0.0932 | 0.0777 |
14.0000 | 0.1507 | 0.1658 | 0.1824 | 0.2006 | 0.2207 | 0.3028 | 0.0717 | 0.0598 |
15.0000 | 0.1370 | 0.1507 | 0.1658 | 0.1824 | 0.2006 | 0.2752 | 0.0552 | 0.0460 |
16.0000 | 0.1246 | 0.1370 | 0.1507 | 0.1658 | 0.1824 | 0.2502 | 0.0424 | 0.0354 |
17.0000 | 0.1132 | 0.1246 | 0.1370 | 0.1507 | 0.1658 | 0.1925 | 0.0326 | 0.0218 |
18.0000 | 0.1029 | 0.1132 | 0.1246 | 0.1370 | 0.1507 | 0.1481 | 0.0251 | 0.0167 |
19.0000 | 0.0936 | 0.1029 | 0.1132 | 0.1246 | 0.1370 | 0.1139 | 0.0193 | 0.0129 |
20.0000 | 0.0851 | 0.0936 | 0.1029 | 0.1132 | 0.1246 | 0.0876 | 0.0176 | 0.0117 |
21.0000 | 0.0773 | 0.0851 | 0.0936 | 0.1029 | 0.1132 | 0.0674 | 0.0160 | 0.0106 |
22.0000 | 0.0703 | 0.0773 | 0.0851 | 0.0936 | 0.1029 | 0.0518 | 0.0145 | 0.0097 |
23.0000 | 0.0639 | 0.0703 | 0.0773 | 0.0851 | 0.0936 | 0.0399 | 0.0132 | 0.0088 |
24.0000 | 0.0581 | 0.0639 | 0.0703 | 0.0773 | 0.0851 | 0.0307 | 0.0120 | 0.0080 |
25.0000 | 0.0528 | 0.0581 | 0.0639 | 0.0703 | 0.0773 | 0.0236 | 0.0109 | 0.0073 |
26.0000 | 0.0480 | 0.0528 | 0.0581 | 0.0639 | 0.0703 | 0.0182 | 0.0099 | 0.0066 |
27.0000 | 0.0437 | 0.0480 | 0.0528 | 0.0581 | 0.0639 | 0.0140 | 0.0090 | 0.0060 |
28.0000 | 0.0397 | 0.0437 | 0.0480 | 0.0528 | 0.0581 | 0.0107 | 0.0082 | 0.0055 |
29.0000 | 0.0361 | 0.0397 | 0.0437 | 0.0480 | 0.0528 | 0.0083 | 0.0074 | 0.0050 |
30.0000 | 0.0328 | 0.0361 | 0.0397 | 0.0437 | 0.0480 | 0.0064 | 0.0068 | 0.0045 |
<tbody>
</tbody>
I have placed into a normal module the following code (based on what I was able to pick up from MSDN):
Code:
[COLOR=#2E8B57][FONT=Monaco]Dim myClassModule As New EventClassModule[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Sub InitializeChart()[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco] Set myClassModule.myChartClass = Worksheets(1).ChartObjects(1).Chart[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]End Sub[/FONT][/COLOR]
And I have placed the following code into a class module named EventClassModule (also based on what I was able to pick up from MSDN):
Code:
[COLOR=#2E8B57][FONT=Monaco]Public WithEvents myChartClass As Chart[/FONT][/COLOR]
I want to rotate the chart by using click and drag, and, if possible, I'd also like to be able to zoom in and out via some method (say a mouse wheel event).
In the following link, a guy named Gabor Doka has done a beautiful job of enabling scatter plot rotation using scroll bars, but I'd like to be able to use mouse events instead:
3d scatter plot for MS Excel (VBA macro)
Please help! Thanks, and I hope to hear from someone
Justin