Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Dim db As dao.Database, rs As dao.Recordset Dim i As Integer, j As Integer Dim xlObj As Object Dim Sheet As Object Set db = currentdb Set rs = db.OpenRecordset("yourQuery") Set xlObj = CreateObject("Excel.Application") xlObj.Workbooks.Add Set Sheet = xlObj.ActiveWorkbook.sheets(1) 'copy the headers Dim iRow, iCol iRow = 2 For iCol = 0 To rs.Fields.Count - 1 Sheet.Cells(iRow, iCol + 1).Value = rs.Fields(iCol).Name Next Sheet.Range("A3").CopyFromRecordset rs 'this copy just the data sheet.range("A1").Value=txtStartDt & "-" & txtEndDt xlObj.Visible = True
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.