# hlep:Question on surface plot

#### ushank

##### New Member
Hello All,

I am a newbee on this board.
I have to generate a matrix and plot data in surface plot and export it.
An element of matrix is obtained by the product of the corresponding row and column. For example 5th element in first row is 1*5=5 or 7th element in second row is 2*7

I tried to generate the matrix and given below was my best effort.
I don't have any clue abt how to get the surface plot.

Sub Surfaceplot()
Dim matrix(1 To 15, 1 To 15) As Integer
Dim i, j As Integer
For i = 1 To 15
For j = 1 To 15
matrix(i, j) = i * j
Next j
Next i
End Sub

### Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You have this nice grid, and you're using VBA to make a matrix?

In A2:A16 and in B1:P1 enter 1 through 15. Select B2:P16, with B2 the active cell, and enter this formula

=\$A2*B\$1

then hold CTRL and press ENTER. Voila, there's your matrix of i*j.

Select this range, and use the Chart Wizard to create a surface chart.

http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=447

Hello Jon,

But I have to accomplish the task of obtaining the surface plot using a macro.
Any help in this regard is appreciated.

So turn on the macro recorder while you create such a plot, then adjust the recorded code.

Replies
4
Views
145
Replies
0
Views
225
Replies
3
Views
343
Replies
3
Views
335
Replies
14
Views
373

1,218,593
Messages
6,143,374
Members
450,483
Latest member
santvik234

### 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.

### Which adblocker are you using?

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

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