Results 1 to 5 of 5

Thread: Need beginner help with IF statement with OR

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Regular
    Joined
    Nov 2020
    Posts
    16
    Location
    This is a followup from my original post. I got it to work by thinking backwards but the code is ugly as ****. As i said in the header: I am a beginner All the End ifs is because Vba seems to need and End if for every If.
    If ThisDocument.Bookmarks.Exists("Kapitel_EKP_Lantbruk1") = False Then
    If ThisDocument.Bookmarks.Exists("Kapitel_EKP_Lantbruk2") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Eldning_i_det_fria") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Elinstallationer") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Gödningsmedel") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Heta_Arbeten_Lantbruk") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Hästskoning") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Högtryckstvättning") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Inomgårdsutrustning") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Insatsplan") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Lagring") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Motordrivna_fordon") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Släckutrustning") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Torkfläktar") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Uppvärmning") = False Then
    If ThisDocument.Bookmarks.Exists("Rutin_Utrymning") = False Then
        UserForm1.OB_Verksamhet_Lantbruk.Visible = False
        Else
        UserForm1.OB_Verksamhet_Lantbruk.Visible = True
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
    Last edited by Paul_Hossler; 12-06-2020 at 05:11 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •