Skip to content

Instantly share code, notes, and snippets.

@martinctc
Created April 27, 2017 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinctc/06e7ea1590fbbf54bfb6025a4ea660ef to your computer and use it in GitHub Desktop.
Save martinctc/06e7ea1590fbbf54bfb6025a4ea660ef to your computer and use it in GitHub Desktop.
Perform the same action on every sheet. Edit the second Subroutine to customise
Sub SheetsFormatter()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Call action(ws)
Next ws
End Sub
Sub action(ws As Worksheet)
ws.Rows("1:1").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ws.Cells(1, 1).Value = ws.Name
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment