Hello everyone, thank you for taking a look.
I have an excel sheet that has a list of companies, each company has a number of branches underneath. These branches are hidden from view, using the BeforeDoubleClick function I want excel to run a macro and then un-hide the specified rows if a company name cell is double clicked on.
My VBA code under the spreadsheet works, but for some reason it will only work once and then default behaviour of double clicking on a cell to edit resumes.
I have to close excel completely for the code to function again. Very confused.
Here is an example of my code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address = "$A$8" Then
Cancel = True
Call Hide_All
Rows("9:14").Hidden = False
End If
If Target.Address = "$A$15" Then
Cancel = True
Call Hide_All
Rows("16:18").Hidden = False
End If
End Sub
Any help with this would be greatly appreciated!
Bookmarks