ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro won't paste results (https://www.excelbanter.com/excel-discussion-misc-queries/255790-macro-wont-paste-results.html)

JeffH

Macro won't paste results
 
I have a macro that accesses some Access queries and refreshes information in
my Excel worksheet. The queries work and the data properly refreshes the
data in my workbook. I wanted to then have the macro paste some of the
information in certain cells.

I created a macro (Macro2) that grabs the cells and pastes it into the
spreadsheet. This works fine. I created Macro2 so I would not have to
figure out the code and I could just paste it into my original macro.

However, when I take the same code from Macro2 and just append it to the
original macro, the paste does not update the cells. I can see the orginal
macro goes through all the steps (as pasted from Macro2) but the cells don't
get updated.

When I run Macro2 the cells get updated (copied and pasted) from the data I
imported from Access.

I'm stumped, this should work.

Jim Thomlinson

Macro won't paste results
 
Post your code...
--
HTH...

Jim Thomlinson


"JeffH" wrote:

I have a macro that accesses some Access queries and refreshes information in
my Excel worksheet. The queries work and the data properly refreshes the
data in my workbook. I wanted to then have the macro paste some of the
information in certain cells.

I created a macro (Macro2) that grabs the cells and pastes it into the
spreadsheet. This works fine. I created Macro2 so I would not have to
figure out the code and I could just paste it into my original macro.

However, when I take the same code from Macro2 and just append it to the
original macro, the paste does not update the cells. I can see the orginal
macro goes through all the steps (as pasted from Macro2) but the cells don't
get updated.

When I run Macro2 the cells get updated (copied and pasted) from the data I
imported from Access.

I'm stumped, this should work.



All times are GMT +1. The time now is 02:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com