Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default VBA .copy destination


I have this code:

Worksheets("Sheet1").Range("A1:D4").Copy _
destination:=Worksheets("Sheet2").Range("E5")

doing it this way copies the formatting as well, is there a way to copy
just the value over without the cell format?

Thanks in advance


--
jerredjohnson
------------------------------------------------------------------------
jerredjohnson's Profile: http://www.excelforum.com/member.php...o&userid=32236
View this thread: http://www.excelforum.com/showthread...hreadid=562642

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VBA .copy destination

One way...

dim RngToCopy as range
Dim DestCell as range

set rngtocopy = worksheets("Sheet1".range("a1:d4")
set destcell = worksheets("sheet2").range("E5")

destcell.resize(rngtocopy.rows.count,rngtocopy.col umns.count).value _
= rngtocopy.value

========
Another way is to just copy|paste special|values

dim RngToCopy as range
Dim DestCell as range

set rngtocopy = worksheets("Sheet1".range("a1:d4")
set destcell = worksheets("sheet2").range("E5")

rngtcopy.copy
destcell.pastespecial paste:=xlpastevalues



jerredjohnson wrote:

I have this code:

Worksheets("Sheet1").Range("A1:D4").Copy _
destination:=Worksheets("Sheet2").Range("E5")

doing it this way copies the formatting as well, is there a way to copy
just the value over without the cell format?

Thanks in advance

--
jerredjohnson
------------------------------------------------------------------------
jerredjohnson's Profile: http://www.excelforum.com/member.php...o&userid=32236
View this thread: http://www.excelforum.com/showthread...hreadid=562642


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set a default paste option of "Match Destination Format" John H @ EBR Excel Discussion (Misc queries) 1 April 17th 06 09:59 PM
sort source workbook data, maintain formulas in destination workb. jfb191 Excel Worksheet Functions 2 March 23rd 06 09:58 PM
How do I autofill combo boxes with their destination cell? Defoes Right Boot Excel Worksheet Functions 3 January 10th 05 12:49 PM
XL2003 Destination and Source Open but not updating tim Excel Discussion (Misc queries) 2 December 14th 04 01:29 AM
Hyperlinks - identifying source in destination sheet UniDave Excel Discussion (Misc queries) 0 November 25th 04 10:07 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"