Re: VBA Copy Value not Formula again
Thanks Alan very helpful link.
Re: VBA Copy Value not Formula again
Thanks Alan very helpful link.
Hi All,
If someone can help thanks, I just got this code working although the cells that are copied from are created from formulas. I also need a line that copies the range F2:F32 and pastes over B2:B32 in Sheet4.
Could this be written to do exactly the same but for values only thanks in advance!!;
Sub copyrows()
Dim lastrow As Long, erow As Long
lastrow = Sheet4.Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lastrow
If Sheet4.Cells(i, 11) = "SOLD" Then
Sheet4.Cells(i, 10).Copy
erow = Sheet8.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Sheet4.Paste Destination:=Worksheets("TRANSACTIONS").Cells(erow, 1)
Sheet4.Cells(i, 1).Copy
Sheet4.Paste Destination:=Worksheets("TRANSACTIONS").Cells(erow, 2)
Sheet4.Cells(i, 5).Copy
Sheet4.Paste Destination:=Worksheets("TRANSACTIONS").Cells(erow, 3)
Sheet4.Cells(i, 8).Copy
Sheet9.Paste Destination:=Worksheets("TRANSACTIONS").Cells(erow, 4)
Sheet4.Cells(i, 9).Copy
Sheet4.Paste Destination:=Worksheets("TRANSACTIONS").Cells(erow, 5)
End If
Next i
Application.CutCopyMode = False
Sheet8.Columns.AutoFit
Range("A1").Select
End Sub
Display More