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

when you use the .copy method, is there any way to only copy formulas? or
do you have to use the paste method to achieve this?

this copies formats, too

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


--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default copy question

sorry, this should be values, not formulas

when you use the .copy method, is there any way to only copy values? or
do you have to use the paste method to achieve this?

--


Gary


"Gary Keramidas" wrote in message
...
when you use the .copy method, is there any way to only copy formulas? or
do you have to use the paste method to achieve this?

this copies formats, too

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


--


Gary





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default copy question

Gary,

Gary Keramidas wrote:
sorry, this should be values, not formulas

when you use the .copy method, is there any way to only copy values? or do
you have to use the paste method to achieve this?


You could do a copy then paste special values. Or, you could just do
something like this:

Range("B1:B10").Value = Range("A1:A10").Value

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default copy question

This copies only the cells with formulas... Not sure if that is what you
want...

Sub CopyFormulas()
Dim rng As Range

On Error Resume Next
Set rng = Sheet1.Range("A:A").SpecialCells(xlCellTypeFormula s)
On Error GoTo 0

If rng Is Nothing Then
MsgBox "nothing was found"
Else
rng.Copy
End If
End Sub

--
HTH...

Jim Thomlinson


"Gary Keramidas" wrote:

when you use the .copy method, is there any way to only copy formulas? or
do you have to use the paste method to achieve this?

this copies formats, too

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


--


Gary




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default copy question

Here it is for constants...

Sub CopyFormulas()
Dim rng As Range

On Error Resume Next
Set rng = Sheet1.Range("A:A").SpecialCells(xlCellTypeConstan ts)
On Error GoTo 0

If rng Is Nothing Then
MsgBox "nothing was found"
Else
rng.Copy
End If
End Sub
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

This copies only the cells with formulas... Not sure if that is what you
want...

Sub CopyFormulas()
Dim rng As Range

On Error Resume Next
Set rng = Sheet1.Range("A:A").SpecialCells(xlCellTypeFormula s)
On Error GoTo 0

If rng Is Nothing Then
MsgBox "nothing was found"
Else
rng.Copy
End If
End Sub

--
HTH...

Jim Thomlinson


"Gary Keramidas" wrote:

when you use the .copy method, is there any way to only copy formulas? or
do you have to use the paste method to achieve this?

this copies formats, too

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


--


Gary






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default copy question

Is this helpful:

Worksheets("Sheet1").Range("A1:D4").Select
Selection.Cells.SpecialCells(xlCellTypeFormulas).C opy
Destination:=Worksheets("Sheet1").Range("E5")


"Gary Keramidas" wrote:

when you use the .copy method, is there any way to only copy formulas? or
do you have to use the paste method to achieve this?

this copies formats, too

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


--


Gary




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy question


Sheet1.Select
Range("A1:d4").Copy
Sheet2.Select
Range("e5").PasteSpecial Paste:=xlPasteFormulas

should do the trick


--
bill k


------------------------------------------------------------------------
bill k's Profile: http://www.excelforum.com/member.php...nfo&userid=821
View this thread: http://www.excelforum.com/showthread...hreadid=474398

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default copy question

ok, thanks everyone for the replies. i have it now

--


Gary


"Gary Keramidas" wrote in message
...
when you use the .copy method, is there any way to only copy formulas? or
do you have to use the paste method to achieve this?

this copies formats, too

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


--


Gary





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
Another 'Copy To The Next Available Row' Question Joe Excel Discussion (Misc queries) 2 March 29th 10 04:25 AM
copy down question [email protected] Excel Worksheet Functions 6 January 28th 09 12:56 AM
Copy/Paste Question DoubleZ Excel Discussion (Misc queries) 3 September 24th 08 11:13 PM
Copy Formula Question phowe43 Excel Discussion (Misc queries) 2 February 5th 08 07:28 PM
copy-move question nastech Excel Discussion (Misc queries) 1 January 31st 06 03:16 AM


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

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

About Us

"It's about Microsoft Excel"