If-Then-Else Anweisung
Daniel
bin leider kein VBA-Experte. Habe aber ein Problem mit einer VBA-Anweisung und hoffe Ihr könnt mir dabei weiterhelfen. Das Problem ist, das ich eine Exceltabelle als Präsentation (ohne Menü, Scrollbars, usw..) darstellen möchte wenn eine Bedingung x=1 erfüllt ist. Doch leider funzt es nicht (unten der Code). Könnt Ihr mir weiterhelfen? Vielen Dank im Voraus!
Daniel
Private Sub CommandButton1_Click()
If x = 1 Then
Dim symbol As CommandBar
For Each symbol In Application.CommandBars
symbol.Enabled = False
Next symbol
With ActiveWindow
.DisplayHeadings = False
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
End With
Else
Application.ScreenUpdating = False
Dim symbol As CommandBar
For Each symbol In Application.CommandBars
symbol.Enabled = True
Next symbol
With ActiveWindow
.DisplayHeadings = True
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
End With
Application.DisplayFormulaBar = True
Application.ScreenUpdating = True
End If
Sheets("2002").Select
End Sub