Skip to content

Instantly share code, notes, and snippets.

View dancobb's full-sized avatar

Dan Cobb dancobb

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dancobb on github.
  • I am dancobb (https://keybase.io/dancobb) on keybase.
  • I have a public key ASDa1G48N_M_eQYzYuLI4n8e67H9OCiyoo-SCMNyMyo5Jgo

To claim this, I am signing this object:

@dancobb
dancobb / gist:aa59a815e11fd795b03400ed3d3fc38d
Created December 16, 2021 23:19
Excel stuff with sausages
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.