ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying From WB To WB (https://www.excelbanter.com/excel-programming/438385-copying-wb-wb.html)

Paul W Smith

Copying From WB To WB
 
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.




Dave Peterson

Copying From WB To WB
 
Is the range Export filtered?



Paul W Smith wrote:

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.


--

Dave Peterson

Roger Govier[_3_]

Copying From WB To WB
 
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" wrote in message
...
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





All times are GMT +1. The time now is 03:15 PM.

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