DATA IN CLIPBOARD

  • Thread starter Thread starter JIMSINC
  • Start date Start date
J

JIMSINC

I am trying to write a macro that copies a named range in
one file and copies the named range data to another file.
I am using the record macro feature in Excel and when I
go to close the file that I have copied the data from a
window comes up and asked if I want to get rid of the
data that is in the clipboard. My answer is "NO" but the
macro recorder does not record this.

Is there any way I can stop the data from staying in the
clipboard or a statement that I an can put in the macro
to say "NO".
 
At the beginning of the macro:

Application.DisplayAlerts = False

At the end of the macro:

Application.DisplayAlerts = True

Cheers
Juan
 
i think the alerts pops up when you close the file
and 'leave a large amount of data' :)

if you use syntax like this make sure the third line is added..
rng1.copy
rng2.paste

'this empties the clipboard.
application.cutcopymode=false


you could copy the data without using the clipboard by using the
destination argument in the copy method, rather than a separate
copy paste

Like this... (muy faster too ;)

Workbooks(1).Worksheets(2) _
.Range(a1:a1000").copy destionation:= _
Workbooks(2).Worksheets(1) _
.Range("b2:b1001")
'note above should be 1 statement with line continuation






keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Back
Top