Spodnji makro naj bi ko so določeni pogoji izpolnjeni skrival vrstice in stolpce, neodvisno eno od drugega. Problem je ta da za vrstice deluje, zatakne se pri stolpcih, ki jih noče skriti, čeprav vem da so pogoji izpolnjeni
Hvala za pomoč
Koda: Izberi vse
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'skriva določene prazne crstice oz. območja
Dim intStartRow As Long
Dim intEndRow As Long
Dim intCounter As Integer
Dim intStartCol As Long
Dim intEndCol As Long
Dim intCount As Integer
intStartRow = 14
intEndRow = 30
intStartCol = 31
intEndCol = 33
For intCounter = intStartRow To intEndRow
If intCounter = 24 Then GoTo Konec
If Range("AH" & intCounter).Value = 0 Or Range("AH" & intCounter).Value = "" Then
'skrij vrstico
Rows(intCounter & ":" & intCounter).EntireRow.Hidden = True
Else
' odkrij vrstico
Rows(intCounter & ":" & intCounter).EntireRow.Hidden = False
End If
Konec:
Next intCounter
For intCount = intStartCol To intEndCol
If Cells(4, intCount).Value = 0 Or Cells(4, intCount).Value = "" Then
' skrij stolpec
Columns(intCount).EntireColumn.Hidden = True
Else
' odkrij stolpec
Columns(intCount).EntireColumn.Hidden = False
End If
Next intCount
End Sub