Skip to content

Instantly share code, notes, and snippets.

@hoffstein
Created July 27, 2011 13:42
Show Gist options
  • Save hoffstein/1109380 to your computer and use it in GitHub Desktop.
Save hoffstein/1109380 to your computer and use it in GitHub Desktop.
Excel find worksheet by name
Function FindWorksheet(sheetName As String) As Worksheet
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name = sheetName Then Set FindWorksheet = ws
Next
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment