Copy values only

  • Thread starter Francis Hookham
  • Start date
F

Francis Hookham

RowNum = ActiveCell.Row
Cells(RowNum, 29).Copy Destination:=Cells(28, 5)
Cells(RowNum + 1, 29).Copy Destination:=Cells(30, 5)
Cells(RowNum + 2, 29).Copy Destination:=Cells(32, 5)

seems to copy everything.

can this be modified to copy only values only?

Francis Hookham
 
M

merjet

Replace your first line with:
Cells(RowNum, 29).Copy
Cells(28, 5).PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Replace the other two similarly.

Hth,
Merjet
 
G

Guest

Francis,

You make the choice at paste time, try:-

Sub atlantic()
RowNum = ActiveCell.Row
Cells(RowNum, 29).Copy
Cells(28, 5).PasteSpecial Paste:=xlPasteValues
Cells(RowNum + 1, 29).Copy
Cells(30, 5).PasteSpecial Paste:=xlPasteValues
Cells(RowNum + 2, 29).Copy
Cells(32, 5).PasteSpecial Paste:=xlPasteValues
End Sub

Mike
 
D

Don Guillett

try this idea for values only. Ranges must the same size.
cells(28, 5).value=Cells(RowNum, 29).value

or maybe this to do it all
rownum=1
for i=28 to 32 step 2
cells(i,5).value=cells(rownum,29).value
rownum =rownum+1
next
 
F

Francis Hookham

Many thanks Don - the neatness of your second suggestion was what I was
looking for.

Thanks too to Merjet and Mike.

Francis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top