View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default How to copy cells content only

You can change these lines:

ltgms.Copy ltrec.Cells(ltrow, "F")
lhcp.Copy ltrec.Cells(ltrow, "N")
lwon.Copy ltrec.Cells(ltrow, "O")
llost.Copy ltrec.Cells(ltrow, "P")

To this:

ltgms.Copy
ltrec.Cells(ltrow, "F").PasteSpecial Paste:=xlPasteValues
lhcp.Copy
ltrec.Cells(ltrow, "N").PasteSpecial Paste:=xlPasteValues
lwon.Copy
ltrec.Cells(ltrow, "O").PasteSpecial Paste:=xlPasteValues
llost.Copy
ltrec.Cells(ltrow, "P").PasteSpecial Paste:=xlPasteValues

This is the second syntax example I gave you for copying. The only
requirement is that there be at least the same amount of cells and
shape to the receiving range.






"cgnotrom" wrote:

I have tried your suggestion without any luck. Im sure I have not done it
correctly
I have some actual code for your evaluation;

Sub copystuff()

Dim lt As String
Set recap = Sheets("Input")
Set ltgms = Sheets("Input").Range("M15:O15") '.Resize(1, 3)
Set lhcp = Sheets("Input").Range("L14")
Set lwon = Sheets("Input").Range("K19")
Set llost = Sheets("Input").Range("K20")
ltrec = 10 * recap.Cells(4, 4).Value
lt = ltrec
Set ltrec = Sheets(lt)
ltrow = recap.Range("D3") + 13
ltgms.Copy ltrec.Cells(ltrow, "F")
lhcp.Copy ltrec.Cells(ltrow, "N")
lwon.Copy ltrec.Cells(ltrow, "O")
llost.Copy ltrec.Cells(ltrow, "P")
End Sub
Remember I do not want the formatting or the formulas, only the values.
Thanks for your time
Chris
"JLGWhiz" wrote:

One way without using copy:

Sheets(2).Range("B5") = Sheets(1).Range("D10").Value

Using copy:

Sheets(1).Range("D10").Copy
Sheets(2).Range("B5").PasteSpecial Paste:=xlPasteValues

"cgnotrom" wrote:

Using 2007 Excell and trying to send data to a child sheet
Currently I am getting the Formula and Colors and Borders.
I only want the Value result of the formula to be copyed to the next sheet,
not the Formula.

example of a command I am using;

Set lg = Sheets("mine").Cells(6,13).Resize(1,3)

tryed to enter the statement Type:=xlFillWithContents
but the debugger didn't like me.
Please help !