Hi there, I have the following code. It copies values from sheet 1 to sheet 2, with the range of A2:J999. The issue, is that the range is actually dynamic. Sometimes, I just need A2:J10, other times, A2:J25.
Should I be performing this function using a different method? Throughout this function, I also want to add a value "Not Exported" to column K. Is it easy to append this value to each row as part of this function?
Thank you all very much, in advance Have a great night.
Should I be performing this function using a different method? Throughout this function, I also want to add a value "Not Exported" to column K. Is it easy to append this value to each row as part of this function?
Thank you all very much, in advance Have a great night.
Code:
Function CopyResults()
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Set copySheet = Worksheets("1")
Set pasteSheet = Worksheets("2")
copySheet.Range("A2:J999").Copy
pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Function