ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy destination (https://www.excelbanter.com/excel-programming/387559-copy-destination.html)

Francis Hookham

Copy destination
 
This does just what I want:

Sub TestTransfer()
Sheets("Pages").Cells(10, 5).Copy Destination:=Sheets("Schedule").Cells(5,
2)
Sheets("Pages").Cells(10, 3).Copy Destination:=Sheets("Schedule").Cells(5,
3)
End Sub

except it copies across the formatting and well as the contents.

I want contents only copied across.

Please - thanks.

Francis Hookham



Norman Jones

Copy destination
 
Hi Francis,

Try something like:

'=============
PublicSub TestTransfer()
With Sheets("Schedule")
.Cells(5, 2).Value = Sheets("Pages").Cells(10, 5).Value
.Cells(5, 3).Value = Sheets("Pages").Cells(10, 3).Value
End With
End Sub
'<<=============


---
Regards,
Norman


"Francis Hookham" wrote in message
...
This does just what I want:

Sub TestTransfer()
Sheets("Pages").Cells(10, 5).Copy Destination:=Sheets("Schedule").Cells(5,
2)
Sheets("Pages").Cells(10, 3).Copy Destination:=Sheets("Schedule").Cells(5,
3)
End Sub

except it copies across the formatting and well as the contents.

I want contents only copied across.

Please - thanks.

Francis Hookham




Don Guillett

Copy destination
 
Ranges must be the same size.

--
Don Guillett
SalesAid Software

"Norman Jones" wrote in message
...
Hi Francis,

Try something like:

'=============
PublicSub TestTransfer()
With Sheets("Schedule")
.Cells(5, 2).Value = Sheets("Pages").Cells(10, 5).Value
.Cells(5, 3).Value = Sheets("Pages").Cells(10, 3).Value
End With
End Sub
'<<=============


---
Regards,
Norman


"Francis Hookham" wrote in message
...
This does just what I want:

Sub TestTransfer()
Sheets("Pages").Cells(10, 5).Copy
Destination:=Sheets("Schedule").Cells(5, 2)
Sheets("Pages").Cells(10, 3).Copy
Destination:=Sheets("Schedule").Cells(5, 3)
End Sub

except it copies across the formatting and well as the contents.

I want contents only copied across.

Please - thanks.

Francis Hookham





Norman Jones

Copy destination
 
Hi Don,

Ranges must be the same size.


Perhaps, in the context of my code, you could expand your comments?

By the way, did you try the code?


---
Regards,
Norman



Norman Jones

Copy destination
 
Hi Francis,

A slight typo!

Replace:

PublicSub TestTransfer()


with

Public Sub TestTransfer()


---
Regards,
Norman




All times are GMT +1. The time now is 01:01 AM.

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