ExcelTryhard
New Member
- Joined
- Nov 13, 2015
- Messages
- 2
I've been fiddling and learning all about the wonders of VBA recently and have been loving it, right up until I came across the concept of hiding toolbars etc.
I've managed to lose the ability to right click in excel which was kind of what I was trying to do but I've done it a bit too permanently and can't get that feature back!
Using the following code, I can run this macro manually and get my right click back but as soon as I close the workbook (Saving it) and try to reopen any workbook or new blank book, I go back to having no right click functionality
The thing that is really getting to me is that my workbook_open() (or Auto_open / workbook_activate) scripts no longer work either, even just a simple msgbox doesn't appear so I really have no idea how this is happening?!
Edit: The workbook_open is now working so I can sort it that way but at the moment there still seems to be a mischievous bit of code or a setting somewhere as even if I open up Excel with a new workbook I can't right click... And its Excel 2013 Im using
The only other code I've got is in a module and I'm 99.9% sure that that can't be affecting it...
I've managed to lose the ability to right click in excel which was kind of what I was trying to do but I've done it a bit too permanently and can't get that feature back!
Using the following code, I can run this macro manually and get my right click back but as soon as I close the workbook (Saving it) and try to reopen any workbook or new blank book, I go back to having no right click functionality
The thing that is really getting to me is that my workbook_open() (or Auto_open / workbook_activate) scripts no longer work either, even just a simple msgbox doesn't appear so I really have no idea how this is happening?!
Edit: The workbook_open is now working so I can sort it that way but at the moment there still seems to be a mischievous bit of code or a setting somewhere as even if I open up Excel with a new workbook I can't right click... And its Excel 2013 Im using
Code:
[COLOR=#333333]With Application[/COLOR]
[COLOR=#333333].DisplayFormulaBar = True[/COLOR]
[COLOR=#333333].CommandBars("Worksheet Menu Bar").Controls("Tools").Controls("Options...").Enabled = True[/COLOR]
[COLOR=#333333].CommandBars("Worksheet Menu Bar").Controls("View").Controls("Formula Bar").Enabled = True[/COLOR]
[COLOR=#333333].CommandBars("Worksheet Menu Bar").Controls("View").Controls("Toolbars").Enabled = True[/COLOR]
[COLOR=#333333].CommandBars("Toolbar List").Enabled = True[/COLOR]
[COLOR=#333333].CommandBars("Worksheet Menu Bar").Controls("Tools").Controls("Customize...").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("File").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("Edit").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("View").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("Worksheet Menu Bar").Controls("Insert").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("Format").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("Tools").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("Data").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("Window").Enabled = True[/COLOR]
[COLOR=#333333]Application.CommandBars("Help").Enabled = True[/COLOR]
[COLOR=#333333]For Each a In Application.CommandBars[/COLOR]
[COLOR=#333333]Application.CommandBars(a.Name).Enabled = True[/COLOR]
[COLOR=#333333]Next[/COLOR]
[COLOR=#333333]End With[/COLOR]
The only other code I've got is in a module and I'm 99.9% sure that that can't be affecting it...
Code:
Sub Linktoworksheets()Dim sh As Worksheet
Dim cell As Range
Dim i As Integer
Dim j As Integer
'Add sheet links
Range("B3:B1000").ClearContents
Range("B3").Select
For Each sh In ActiveWorkbook.Worksheets
If ActiveSheet.Name <> sh.Name Then
ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'" & sh.Name & "'" & "!B3", TextToDisplay:=sh.Name
ActiveCell.Offset(1, 0).Select
End If
Next sh
End Sub
Sub SortSheets()
'Sort sheets alphanumerically
For i = 1 To Sheets.Count
For j = 1 To Sheets.Count - 1
If UCase$(Sheets(j).Name) < UCase$(Sheets(j + 1).Name) Then
Sheets(j).Move After:=Sheets(j + 1)
End If
Next j
Next i
End Sub
Sub NewSheet()
Sheets("Template").Select
Sheets("Template").Copy Before:=Sheets(3)
End Sub
Last edited: