Help with a Copy and Paste Macro

T

Tysone

I tired to get an answer for this over in excel.function over the last
week, but I wasn't able to get an answer. Hopefully someone over here
that doesn't check that will be able to help me out.

Here is my problem. I have this macro that takes a line and copies it
to the end of a list on another tab. The one problem? I need it to
Paste special - Values. And if you can write a better macro then this
one that does what I need, please do. I just need it to work
correctly.

Thanks

Tyson


Sub copytolist()
Sheets("Data Enter").Activate
Range("A2:C2").Copy Destination:=Sheets("Data List") _
.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
End Sub
 
A

Andy

Try:

Sub copytolist()

Sheets("Data Enter").Range("a2:c2").Copy
Sheets("Data List").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial
Paste:=xlValues, Operation:=xlNone, SkipBlanks:= False, Transpose:=False

End Sub


hth

AndyO
 
D

Dave Peterson

Another option is to just plop the value into the cell:

sub copytolist()
dim myRng as range
set myrng = worksheets("data enter").range("a2:c2")

with worksheets("data list")
.cells(.rows.count,1).end(xlup).offset(1,0) _
.resize(myrng.rows.count,myrng.columns.count).value _
= myrng.value
end with
end sub

by using the myrng variable (and myrng.rows.count & myrng.columns.count), it'll
make it a tiny bit easier if you ever decide to change the size of the range to
be copied.
 
Top