Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GLS GLS is offline
external usenet poster
 
Posts: 8
Default Copying Data from Access to Excel in a macro

Hi

I've been trying to set up a macro to copy & paste data from an Access Table
to an Excel Worksheet and I cant get it to work. It fails at the
'ActiveSheet.Paste' stage shown below.

Cells.Select
ActiveSheet.Paste
ActiveWorkbook.Save
End Sub

I created the macro starting in the Excel Worksheet, then going to the
Access Table, copying it, then returning to Excel and pasting the data in the
worksheet. As you can see from the VBA, it doesnt seem to have recorded any
of the Access part of the macro.

Any suggestions where I'm going wrong?

Many thanks

GLS
--
GLS
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Copying Data from Access to Excel in a macro

I would record a macro with the following steps:

1) In excel, go to Data--Get External Data
2) Select "Import External Data"
3) Navigate to the Access db and double-click on it
4) Select the table or query which you want to import into Excel
5) Click Ok.
6) Stop the macro recorder.

Dave
--
Brevity is the soul of wit.


"GLS" wrote:

Hi

I've been trying to set up a macro to copy & paste data from an Access Table
to an Excel Worksheet and I cant get it to work. It fails at the
'ActiveSheet.Paste' stage shown below.

Cells.Select
ActiveSheet.Paste
ActiveWorkbook.Save
End Sub

I created the macro starting in the Excel Worksheet, then going to the
Access Table, copying it, then returning to Excel and pasting the data in the
worksheet. As you can see from the VBA, it doesnt seem to have recorded any
of the Access part of the macro.

Any suggestions where I'm going wrong?

Many thanks

GLS
--
GLS

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GLS GLS is offline
external usenet poster
 
Posts: 8
Default Copying Data from Access to Excel in a macro

Dave

Thanks - that worked great.

GLS
--
GLS


"Dave F" wrote:

I would record a macro with the following steps:

1) In excel, go to Data--Get External Data
2) Select "Import External Data"
3) Navigate to the Access db and double-click on it
4) Select the table or query which you want to import into Excel
5) Click Ok.
6) Stop the macro recorder.

Dave
--
Brevity is the soul of wit.


"GLS" wrote:

Hi

I've been trying to set up a macro to copy & paste data from an Access Table
to an Excel Worksheet and I cant get it to work. It fails at the
'ActiveSheet.Paste' stage shown below.

Cells.Select
ActiveSheet.Paste
ActiveWorkbook.Save
End Sub

I created the macro starting in the Excel Worksheet, then going to the
Access Table, copying it, then returning to Excel and pasting the data in the
worksheet. As you can see from the VBA, it doesnt seem to have recorded any
of the Access part of the macro.

Any suggestions where I'm going wrong?

Many thanks

GLS
--
GLS

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data from Access to Excel Paul Dennis Excel Discussion (Misc queries) 8 October 10th 06 06:33 PM
Data Refresh Issues when linking Access queries to Excel Rob Excel Discussion (Misc queries) 0 October 6th 06 06:40 PM
consolidation of tables in excel with text and figures samenvoegen van sheets Excel Worksheet Functions 8 March 2nd 06 03:27 PM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
How to import data from a password protected Access DB into Excel. Agus Excel Discussion (Misc queries) 0 October 12th 05 05:42 PM


All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"