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

Sorry for the late response, have been busy lately.

This might work for you, you are going to have to mod it based on number gen code but you should be able to follow it. This was written in textedit on my mac, so theres no way I could test it (I don't have the tools on my windows VM) but I wrote something like this for exporting data from Active Directory.. so it might work.

Dim ObjWb
Dim ObjExcel
Dim x, zz
Call ExcelSetup("Sheet1")
x = 1
On Error Resume Next
For Each Number In OtherNumber
x = x +1
objwb.Cells(x, 1).Value = Number
objwb.Cells(x, 2).Value = Other Number
Next
Sub ExcelSetup(shtName)
Set objExcel = CreateObject("Excel.Application")
Set objwb = objExcel.Workbooks.Add
Set objwb = objExcel.ActiveWorkbook.Worksheets(shtName)
Objwb.Name = "Numbers and Stuff"
objwb.Activate
objExcel.Visible = True
objwb.Cells(1, 1).Value = "Number"
objwb.Cells(1, 2).Value = "Other Number"
End Sub

Hope it helps

- Majik
Genius has it's limits, but insanity knows no bounds.

Private Sub calculatetablex()
Dim x As Double
Dim y As Double
For i As Double = QuadraticTable.startval To QuadraticTable.endvalue Step QuadraticTable.stepval
ammount = ammount + 1
If QuadraticTable.bvar >= 0 Then
If QuadraticTable.cvar >= 0 Then
x = QuadraticTable.avar * (i) ^ 2 + QuadraticTable.bvar * i + QuadraticTable.cvar
End If
If QuadraticTable.cvar < 0 Then
x = QuadraticTable.avar * (i) ^ 2 + QuadraticTable.bvar * i - (QuadraticTable.cvar)
End If
ElseIf QuadraticTable.bvar < 0 Then
If QuadraticTable.cvar >= 0 Then
x = QuadraticTable.avar * (i) ^ 2 - (QuadraticTable.bvar * i) + QuadraticTable.cvar
End If
If QuadraticTable.cvar < 0 Then
x = QuadraticTable.avar * (i) ^ 2 - (QuadraticTable.bvar * i) - (QuadraticTable.cvar)
End If
End If
xtable.Items.Add(x.ToString())
y = i
ytable.Items.Add(y.ToString())
Next
End Sub