Macro Paste & VB Code problem

  • Thread starter Thread starter Paul Watkins
  • Start date Start date
P

Paul Watkins

Hi

I have a Spreadsheet that has VB Code under 'Sheet1' that does various
calculations.
In 'workbook open' i have
Range ("A1").Select ( this updates Sheet1) from opening the workbook.

The Problem:
I Also have a macro that transfers some data from one workbook into this
one.(run on certain dates only)
part of this macro requires a paste into a range of cells.
For some reason it crashes at the point of pasting ( i think it's because i
have A1 selected from the Workbook Open)

Is there any way around this.


Thanks in advance

Paul
 
The main reasons for Paste failing are :-
1. nothing in the clipboard to paste (no "Copy")
2. The sheet must be Active to accept paste.
3. The paste range size not the same as copy range ( paste to a *singl
cell* - top left corner of position required)
 
Paul,

I think we need more in fo, some code and details of what you do and the
error.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Another possibility is that a control on the sheet that you are tryin
to paste to has the focus.

If your vba code is called from a command button on the sheet that yo
are pasting data to, make sure that the TakeFocusOnClick property fo
that button is set to False.

Some controls don't have this TakeFocusOnClick property, if this is th
case insert the code ActiveCell.Activate, after Activating the sheet t
paste to, but before pasting the data
 
Thanks for all the replies.
The code was just too big to post here and it's controlling 3 different
workbooks.
However the solution i have gone for is to remove all the sheet code and
place in a macro which is then called from another workbook.It seems to work
at the moment, it may have some knock on effects, so i might be back again
with a similar question :)

Thanks


Paul
 
Back
Top