Hello. I am a completely new to vba. I was given a worksheet with multiple scenario macros. After each macro, I'd like lines of code to copy all the contents of that worksheet into a sheet named after each scenario.
So, after the first scenario1 code is run, the contents of the sheet for scenario1 is copied to a NEW sheet (would have to create the sheet) scenario1output. Scenario2 code is run, contents are copied into scenario2output sheet.
Ideally it would look to see if there is already a scenario1output or scenario2output sheet before creating a new one, but if that's getting complicated, that's okay...
Any help would be appreciated!
What I've got so far that keeps crashing...
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+Q
'
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet27").Select
Sheets("Sheet27").Name = "Scenario2output"
Application.Goto Reference:="Sheet1!RC"
Selection.Copy
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Application.Goto Reference:="Scenario2output!RC"
ActiveSheet.Paste
End Sub
Bookmarks