Denne burde virke, testet i Excel 2003:
Sub Vis_skjul()
home = ActiveCell.Address
homeArk = ActiveSheet.Name
antrk = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
KolBog = Mid(home, 2, InStr(2, home, "$") - 2)
Select Case KolBog
Case "A" To "F"
Exit Sub
End Select
Application.ScreenUpdating = False
If Columns("G:XFD").Hidden = True Or Rows(9).Hidden Then GoTo Vis
Columns("G:XFD").Hidden = True
KolBog = Mid(ActiveCell.Address, 2, InStr(2, ActiveCell.Address, "$") - 2)
Columns(KolBog).Hidden = False
For Række = 9 To antrk
If Range(KolBog & Række) = "" Then
Rows(Række).Select
Selection.EntireRow.Hidden = True
End If
Next
GoTo skjul
Vis:
Columns("G:XFD").Hidden = False
Cells.EntireRow.Hidden = False
Sheets(homeArk).Select
Range(home).Select
skjul:
Application.ScreenUpdating = True
Sheets(homeArk).Select
Range(home).Select
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Makro køres ved dobbelt-klik i cellerne G1, H1 og I1
'tilføj selv flere....
If Target.Address = "$G$1" Or _
Target.Address = "$H$1" Or _
Target.Address = "$I$1" Then
Target.Offset(1, 0).Activate
home = ActiveCell.Address
homeArk = ActiveSheet.Name
antrk = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
KolBog = Mid(home, 2, InStr(2, home, "$") - 2)
Select Case KolBog
Case "A" To "F"
Exit Sub
End Select
Application.ScreenUpdating = False
If Columns("G:XFD").Hidden = True Or Rows(9).Hidden Then GoTo Vis
Columns("G:XFD").Hidden = True
KolBog = Mid(ActiveCell.Address, 2, InStr(2, ActiveCell.Address, "$") - 2)
Columns(KolBog).Hidden = False
For Række = 9 To antrk
If Range(KolBog & Række) = "" Then
Rows(Række).Select
Selection.EntireRow.Hidden = True
End If
Next
GoTo skjul
Vis:
Columns("G:XFD").Hidden = False
Cells.EntireRow.Hidden = False
Sheets(homeArk).Select
Range(home).Select
skjul:
Application.ScreenUpdating = True
Sheets(homeArk).Select
Range(home).Select
End If
End Sub