Iif cell contains same name as any sheet in workbook copy sheet

Jagwarman used Ask the Experts™
with VBA I want to copy a sheet where the name in cell M14 has the name of the sheet.

i.e. if M14 = Option 3 copy the sheet name Option 3

i.e. if M14 = Option 10 copy the sheet name Option 10

Thanks in advance
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
on error resume next
on error goto 0
Software Team Lead

Sub Button1_Click()
    Call copyWS(Range("M14").Value)
End Sub

Sub copyWS(wsName As String)
    Sheets(wsName).Copy After:=Sheets(Sheets.Count)
End Sub

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial