VBA: copy paste without clipboard

Is there a way to do this as a single copy of a line / paste without using the clipboard. copy one range - a row to another range of sheet paste - a whole line. I need values, not a formula.

 Sheets("Data").Select 
 ActiveCell.EntireRow.Copy

 Sheets("TSP").Select
 ActiveCell.PasteSpecial Paste:=xlPasteValues
+3
source share
2 answers

These values ​​are copy code (not formulas).

Sub a()
  Worksheets("Sheet2").Range("TS").Value=Worksheets("Sheet1").Range("1:1").Value
End Sub  

Where "TS" is the name of the range (single line).

Is this what you are trying to achieve?

Edit

To copy the active line to Sheet2.Row2 (for example), you can try:

Sub a()
 Dim myrow As Integer
 myrow = ActiveWindow.RangeSelection.Row
 Worksheets("Sheet2").Range("2:2").Value = Worksheets("Sheet1").Rows(myrow).Value
End Sub

NTN!

+9
source

For some reason, no. PasteSpecial- all about the clipboard.

If you only need values, create a loop Forby copying them.

+1
source

Source: https://habr.com/ru/post/1768861/


All Articles