Created
December 16, 2021 23:19
-
-
Save dancobb/aa59a815e11fd795b03400ed3d3fc38d to your computer and use it in GitHub Desktop.
Excel stuff with sausages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub copypastesomesausagestuff() | |
'Need a worksheet | |
dim anewsheet as worksheet | |
set anewsheet = workbooks("filename.xlsm").worksheets.add | |
anewsheet.name = "sheetname" 'Probably want a function here to give it a dynamic name | |
'Copy and paste the things. Make sure to update ranges. | |
range("A1:B5").copy workbooks("filename.xlsm").worksheets(anewsheet).range("A1:B5") 'Note the anewsheet reference here is the variable from above. | |
'This deselects the copied stuff so your clipboard is good. | |
application.cutcopymode = false | |
end sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment