Hello community,
I use following code to copy paste values from Active Sheet to different sheet. When I run this code first time, it works. But at next tries it does nothing.
What am I doing wrong?
I use following code to copy paste values from Active Sheet to different sheet. When I run this code first time, it works. But at next tries it does nothing.
What am I doing wrong?
VBA Code:
Sub CopyRangeToD()
Dim Rng As Range
Dim LR As Long
Dim LR1 As Long
With ActiveSheet
LR = .Cells(.rows.Count, "A").End(xlUp).Row
End With
With Worksheets("D")
LR1 = .Cells(.rows.Count, "B").End(xlUp).Row + 1
End With
Set Rng = ActiveSheet.Range("A1:E" & LR)
Rng.Copy
Sheet10.Cells(LR1, "A").PasteSpecial xlPasteValues
Application.CutCopyMode = False
End With
End Sub