L
Legacy 428781
Guest
I want to add a line of code to my VBA to copy only the values of column B with no formatting.
Part of my code looks like this:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">If Worksheets("one").Cells(i, 4).Value = "TRUE" Then
Worksheets("one").Cells(i, 2).Copy
erow = Worksheets("two").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("one").Paste Destination:=Worksheets("two").Cells(erow + 1, 1)</code>
A simple paste values method works if a range is specified like this;
Range("A1:A3").Copy
Range("B1:B3").pastespecial xlPasteValues
However what I actually want is to add the paste values into the existing code which is specifying a specific column.
How do I modify my code so only values are copied from column B and pasted into another worksheet?
Part of my code looks like this:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">If Worksheets("one").Cells(i, 4).Value = "TRUE" Then
Worksheets("one").Cells(i, 2).Copy
erow = Worksheets("two").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("one").Paste Destination:=Worksheets("two").Cells(erow + 1, 1)</code>
A simple paste values method works if a range is specified like this;
Range("A1:A3").Copy
Range("B1:B3").pastespecial xlPasteValues
However what I actually want is to add the paste values into the existing code which is specifying a specific column.
How do I modify my code so only values are copied from column B and pasted into another worksheet?