ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy value only (https://www.excelbanter.com/excel-programming/418471-copy-value-only.html)

ron mann

Copy value only
 
Hi All,

I have written a macro and attached same to a control button which will
simply copy the value in WB1, open WB2 and paste the value.

The value from WB1 is contained in merged cells. Could someone assist me
with code that will copy and paste only the value contained in the merged
cells.

--
Thanks

Ron

SeanC UK[_2_]

Copy value only
 
Hi Ron,

I presume that it is currently copying the merged cell format too?

If this is what you are trying to avoid then try using Paste Special (I have
assumed here that you have already selected the WB1 data and copied it):

Range("A1").PasteSpecial Paste:=xlPasteValues

If this is not what you are looking for then please explain the problems you
are having with your code in detail.

Hope this helps,

Sean.



--
(please remember to click yes if replies you receive are helpful to you)


"ron mann" wrote:

Hi All,

I have written a macro and attached same to a control button which will
simply copy the value in WB1, open WB2 and paste the value.

The value from WB1 is contained in merged cells. Could someone assist me
with code that will copy and paste only the value contained in the merged
cells.

--
Thanks

Ron


ron mann

Copy value only
 
Hi Sean,

Thanks, that helps a lot. I am only just starting to write code and your
assistance is greatly appreciated.
--
Thanks

Ron


"SeanC UK" wrote:

Hi Ron,

I presume that it is currently copying the merged cell format too?

If this is what you are trying to avoid then try using Paste Special (I have
assumed here that you have already selected the WB1 data and copied it):

Range("A1").PasteSpecial Paste:=xlPasteValues

If this is not what you are looking for then please explain the problems you
are having with your code in detail.

Hope this helps,

Sean.



--
(please remember to click yes if replies you receive are helpful to you)


"ron mann" wrote:

Hi All,

I have written a macro and attached same to a control button which will
simply copy the value in WB1, open WB2 and paste the value.

The value from WB1 is contained in merged cells. Could someone assist me
with code that will copy and paste only the value contained in the merged
cells.

--
Thanks

Ron



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

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