excel vba - How can i control the position to copy one sheet into another workbook -
i have code copy 1 worksheet of original workbook terminated workbook , works fine. need control paste position terminated workbook. right paste before ever active sheet. want past second sheet after summary sheet. new macro, thanks.
sub copytoternimal() dim copyname string on error goto errmess copyname = inputbox("please enter name of sheet copy ternimal") dim thissheet worksheet set thissheet = workbooks("original.xlsm").worksheets(copyname) thissheet.rows.copy dim newsheet worksheet set newsheet = workbooks("terminated employees.xlsm").worksheets.add() newsheet.name = thissheet.name newsheet.paste thissheet.delete
errexit: exit sub
errmess: msgbox "xxxxxx." goto errexit
end sub
i believe
thissheet.copy after:=workbooks("terminated employees.xlsm").worksheets("name of first summary worksheet")
Comments
Post a Comment