I got a program that generates some numbers (their not random) and i want them to be exported to excell:
This is the code that I have for starting excell:
- Code: Select all
Private Sub exporttoexcell()
Dim excell As Process = Process.Start("C:\Program Files\Microsoft Office\Office12\EXCEL.EXE")
excell.Start()
End Sub
(that is obviously called from the button_click event)
I want the numbers here:
- Code: Select all
f(x) = | x =
-10 | 382
-9 | 308
-8 | 242
-7 | 184
-6 | 134
-5 | 92
-4 | 58
-3 | 32
-2 | 14
-1 | 4
0 | 2
1 | 8
2 | 22
3 | 44
4 | 74
5 | 112
6 | 158
7 | 212
8 | 274
9 | 344
10 | 422
I was thinking of a macro in the excell workbook something along the lines of this:
- Code: Select all
sub insertvalues()
dim y as intger = {how many y's there are from program}
dim x as intger = {how many x's there are from program}
dim xvar (x) as double
dim yvar (y) as double
for i as intger = 0 to y
yvar(i) = {gets value[index] from program}
next
for i as intger = 0 to x
xvar(i)={gets value[index] from program}
next
'then insert into program
for i as intger = 0 to x '{x = y}
sheet1.cells(i,a) = yvar(i)
sheet1.cells(i,b) = xvar(i)
next
end sub
ok anyone any ideas?
