Good morning,
I am looking to log information stored in Access fields to a Excel sheet. My code is working as it stands however it overwrites every entry after the first one (as it is set to A2, B2 and C2)
I think I need an array to log each time the "export_click" is pressed to move the entry down to the next cell so I can get a full log of everytime it is pressed
Any help muchly appriciated, here is what I have, thank you
I am looking to log information stored in Access fields to a Excel sheet. My code is working as it stands however it overwrites every entry after the first one (as it is set to A2, B2 and C2)
I think I need an array to log each time the "export_click" is pressed to move the entry down to the next cell so I can get a full log of everytime it is pressed
Any help muchly appriciated, here is what I have, thank you
VBA Code:
Private Sub Export_Click()
Dim xlApp As Excel.Application
Set xlApp = CreateObject("Excel.Application")
With xlApp
.Visible = True
.Workbooks.Open ("c:\temp\test.xlsx")
.Sheets("Sheet1").Select
.Range("A2") = Me.txtProduct.Value
.Range("B2") = Me.txtQuantity.Value
.Range("C2") = Me.txtCountUp.Value
.ActiveWorkbook.Close True
End With
Set xlApp = Nothing