I'm repeating the first line below several times in order to paste data from multiple sheets into the "template" in my workbook. At the end, the range of cells associated with the last paste will remain selected. Is there a way to deselect that range and/or move the focus to cell A2 without selecting the template sheet? I export the sheet to a separate file and clear the rows that were used at the end of the process but that range remains selected.
VBA Code:
Sheets("S1").Range("A" & lastRow).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
ThisWorkbook.Sheets("S1").Range("2:" & lastRow).Delete xlUp