I need macro

A

Alen32

On sheet1 in row2 I have formulas in some cells and comments in some cells.
I want macro which copy entire row2 from sheet1 and paste on sheet2 and
row3.I don't need formulas only values from cells and comments.
 
J

JW

If this isn't going to be done repetatively, just do it manually.
Highlight the rows that you want to copy and select Copy. Go to where
you want to paste them and right click and select Paste Special. Then
select Values and click OK. Then, immediately after clicking OK,
right click and select Paste Special again. This time, select
Comments and click OK.

If you have to have this in a macro, use something like below.
Sheets("Sheet1").Rows(2).Copy
Sheets("Sheet2").Rows(3).PasteSpecial _
Paste:=xlPasteValues
Sheets("Sheet2").Rows(3).PasteSpecial _
Paste:=xlPasteComments
Application.CutCopyMode = False
 
D

Don Guillett

Sub getvalues()
Sheets("sheet2").Rows(3).Value = _
Sheets("sheet1").Rows(2).Value
End Sub
 
J

JW

Don, that code works fine to get the values, but the OP wanted to get
the comments as well.
 
D

Don Guillett

As Bubba said, it depends on your definition of "is" is. "comments" could
mean
in b1 =a1*2
in c1 "Gee that was two"
or it could be what you offered. Or,

Sub getvalues1()
With Sheets("sheet2").Rows(3)
Sheets("sheet1").Rows(2).Copy
.PasteSpecial Paste:=xlValues
.PasteSpecial Paste:=xlPasteComments
End With
End Sub
 

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