ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I need macro (https://www.excelbanter.com/excel-programming/399365-i-need-macro.html)

Alen32

I need macro
 
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.


--
Message posted using http://www.talkaboutsoftware.com/gro...l.programming/
More information at http://www.talkaboutsoftware.com/faq.html


JW[_2_]

I need macro
 
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

Alen32 wrote:
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.


--
Message posted using http://www.talkaboutsoftware.com/gro...l.programming/
More information at http://www.talkaboutsoftware.com/faq.html



Don Guillett

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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alen32" wrote in message
lkaboutsoftware.com...
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.


--
Message posted using
http://www.talkaboutsoftware.com/gro...l.programming/
More information at http://www.talkaboutsoftware.com/faq.html



JW[_2_]

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

Don Guillett wrote:
Sub getvalues()
Sheets("sheet2").Rows(3).Value = _
Sheets("sheet1").Rows(2).Value
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alen32" wrote in message
lkaboutsoftware.com...
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.


--
Message posted using
http://www.talkaboutsoftware.com/gro...l.programming/
More information at http://www.talkaboutsoftware.com/faq.html



Don Guillett

I need macro
 

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
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JW" wrote in message
ups.com...
Don, that code works fine to get the values, but the OP wanted to get
the comments as well.

Don Guillett wrote:
Sub getvalues()
Sheets("sheet2").Rows(3).Value = _
Sheets("sheet1").Rows(2).Value
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alen32" wrote in message
lkaboutsoftware.com...
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.


--
Message posted using
http://www.talkaboutsoftware.com/gro...l.programming/
More information at http://www.talkaboutsoftware.com/faq.html





All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com