Skip to content

Instantly share code, notes, and snippets.

@bluejaysql
Created March 11, 2015 05:46
Show Gist options
  • Save bluejaysql/65bdb425934dfb6c2780 to your computer and use it in GitHub Desktop.
Save bluejaysql/65bdb425934dfb6c2780 to your computer and use it in GitHub Desktop.
Excel VBA: Simple copy of worksheet
...
Dim wb As Workbook
Set wb = ThisWorkbook
Application.DisplayAlerts = False
Dim ws As Worksheet
For Each ws In wb.Worksheets
If (ws.Name Like "Second Sheet*") Then
ws.Delete
End If
Next
Application.DisplayAlerts = False
Sheets("First Sheet").Copy after:=ThisWorkbook.Sheets("First Sheet")
ActiveSheet.Name = "Second Sheet"
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment