I do not believe this is a difficult question but I am having trouble figuring out the solution..
I have a dbgrid with a variable amount of rows and 4 columns
I want to take the cell value and copy the value into a spreadsheet using the excel control in vb. I am having difficulties calling the cell via variable
Ex.
Dim X As Integer
Dim XX As Integer
xx = data1.recordset .absolutepositi on
for x = 0 to xx
data1.recordset .absolutepositi on = x
y = x + 1
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column1 value")
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column2 value")
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column3 value")
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column4 value")
next x ....
I am receiving an error when trying to reference the Y value when calling the cell
Thanks
I have a dbgrid with a variable amount of rows and 4 columns
I want to take the cell value and copy the value into a spreadsheet using the excel control in vb. I am having difficulties calling the cell via variable
Ex.
Dim X As Integer
Dim XX As Integer
xx = data1.recordset .absolutepositi on
for x = 0 to xx
data1.recordset .absolutepositi on = x
y = x + 1
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column1 value")
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column2 value")
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column3 value")
Spreadsheet1.Ce lls(Y, 1) = Data1.Recordset ("Table column4 value")
next x ....
I am receiving an error when trying to reference the Y value when calling the cell
Thanks
Comment