Bom dia
No ex: do João Paulo
Private Sub SeuBotão_Click()
'By JPaulo ® Maximo Access
Dim rst As DAO.Recordset, strSQL As String, strLivro As String, xls As Object
Set xls = CreateObject("Excel.Application")
strLivro = CurrentProject.Path & "\teste.xls"
xls.Workbooks.Open (strLivro)
xls.Visible = True
xls.Worksheets("Sheet1").Activate
strSQL = "SELECT * FROM teste;"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
xls.ActiveSheet.Range("A1").Select
xls.ActiveCell.CopyFromRecordset rst
xls.ActiveWorkbook.Save
xls.Application.Quit
Set xls = Nothing
End Sub
É Possivel passar os dados para o Excel nas linhas Impares?
Ex: A1, A3; A5; A7 etc.
Obrigado
Pina
No ex: do João Paulo
Private Sub SeuBotão_Click()
'By JPaulo ® Maximo Access
Dim rst As DAO.Recordset, strSQL As String, strLivro As String, xls As Object
Set xls = CreateObject("Excel.Application")
strLivro = CurrentProject.Path & "\teste.xls"
xls.Workbooks.Open (strLivro)
xls.Visible = True
xls.Worksheets("Sheet1").Activate
strSQL = "SELECT * FROM teste;"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
xls.ActiveSheet.Range("A1").Select
xls.ActiveCell.CopyFromRecordset rst
xls.ActiveWorkbook.Save
xls.Application.Quit
Set xls = Nothing
End Sub
É Possivel passar os dados para o Excel nas linhas Impares?
Ex: A1, A3; A5; A7 etc.
Obrigado
Pina