Copying From WB To WB

P

Paul W Smith

I have been looking at this for two hours now and cannot understand what
could be causing what I am seeing.

I have a WB that contains a procedure which can loop through a file listing
and copy the contents of a range onto a WKS within itself.

My issue and I will give the code below is that in some instances it copies
the values in others it copies links to the source file!!!!!!

The code is:

Set RngIn = ShtIn.Range("Export")
RngIn.Copy

ShtPaste.Activate
ShtPaste.Cells(lMaxRow, 1).Select
ShtPaste.Paste

Can anyone suggest a reason why the same code should on some occasions paste
values and others paste links (i.e just paste).

I can only conclude that it must have something to do with the source files,
but to me these look identical. I have checked the cell formats (Custom).
They were produced for the same template and the cells being copied contains
identical formulas in the cells being copied.
 
D

Dave Peterson

Is the range Export filtered?


I have been looking at this for two hours now and cannot understand what
could be causing what I am seeing.

I have a WB that contains a procedure which can loop through a file listing
and copy the contents of a range onto a WKS within itself.

My issue and I will give the code below is that in some instances it copies
the values in others it copies links to the source file!!!!!!

The code is:

Set RngIn = ShtIn.Range("Export")
RngIn.Copy

ShtPaste.Activate
ShtPaste.Cells(lMaxRow, 1).Select
ShtPaste.Paste

Can anyone suggest a reason why the same code should on some occasions paste
values and others paste links (i.e just paste).

I can only conclude that it must have something to do with the source files,
but to me these look identical. I have checked the cell formats (Custom).
They were produced for the same template and the cells being copied contains
identical formulas in the cells being copied.
 
R

Roger Govier

Hi Paul

maybe

Set RngIn = ShtIn.Range("Export")
Set rngOut = ShtPaste.Cells(lMaxRow, 1)
ShtPaste.Activate
RngIn.Copy
rngout.PasteSpecial Paste:=xlPasteValues



--
Regards
Roger Govier

Paul W Smith said:
I have been looking at this for two hours now and cannot understand what
could be causing what I am seeing.

I have a WB that contains a procedure which can loop through a file
listing and copy the contents of a range onto a WKS within itself.

My issue and I will give the code below is that in some instances it
copies the values in others it copies links to the source file!!!!!!

The code is:

Set RngIn = ShtIn.Range("Export")
RngIn.Copy

ShtPaste.Activate
ShtPaste.Cells(lMaxRow, 1).Select
ShtPaste.Paste

Can anyone suggest a reason why the same code should on some occasions
paste values and others paste links (i.e just paste).

I can only conclude that it must have something to do with the source
files, but to me these look identical. I have checked the cell formats
(Custom). They were produced for the same template and the cells being
copied contains identical formulas in the cells being copied.




__________ Information from ESET Smart Security, version of virus
signature database 4767 (20100113) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4768 (20100113) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top