Forum Discussion

AmyYang's avatar
AmyYang
Brass Contributor
Dec 28, 2021

Unable to delete macro - unhide workbook

Hi, 

When I created a macro then tried to delete it, I got error message that I need to unhide the workbook using Unhide command. May you advise where I can do this command?

Thanks,

Amy 

  • AmyYang 

    Activate the View tab of the ribbon.

    You should find the Unhide button in the Window group.

    Click this button, select a workbook from the list, then click OK.

     

    Alternatively, press Alt+F11 to activate the Visual Basic Editor. See if you can find the macro there. If so, simply delete its text.

  • Ray_Frye's avatar
    Ray_Frye
    Copper Contributor
    Unhide workbook by name:
    Sub HidePERSONAL()
    Dim i
    On Error Resume Next
    For i = 1 To Windows.Count
    'Debug.Print Windows(i).Visible
    'Debug.Print Windows(i).Caption
    If Windows(i).Caption = "PERSONAL.XLSB" Then
    Windows(i).Visible = False
    On Error GoTo 0
    Exit For
    End If
    Next i
    End Sub
  • AmyYang 

    Activate the View tab of the ribbon.

    You should find the Unhide button in the Window group.

    Click this button, select a workbook from the list, then click OK.

     

    Alternatively, press Alt+F11 to activate the Visual Basic Editor. See if you can find the macro there. If so, simply delete its text.

    • chimera98026's avatar
      chimera98026
      Copper Contributor
      Thank you!!! I was have the same problem as Amy. Your response to her work perfectly. I was able to delete my macro without further error message.
      Margo Vincent
    • AmyYang's avatar
      AmyYang
      Brass Contributor
      Thank you Hans for your helpful reply!
    • akhona1986's avatar
      akhona1986
      Copper Contributor

      HansVogelaar thanks. My eyes were starting to get teary because the file (the one with macros) was not opening (or showing) so I thought I had lost all that work. Thanks a million.

Resources