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. #1
    VBAX Regular
    Joined
    Nov 2020
    Posts
    16
    Location

    Need beginner help with IF statement with OR

    Hi. This is my code and i get syntax error when i run it. What´s wrong and how can i fix it? I want it to be true if any of the statements exist.

    If ThisDocument.Bookmarks.Exists("Kapitel_EKP_Lantbruk1") = True Or
        ThisDocument.Bookmarks.Exists("Kapitel_EKP_Lantbruk2") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Eldning_i_det_fria") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Elinstallationer") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Gödningsmedel") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Heta_Arbeten_Lantbruk") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Hästskoning") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Högtryckstvättning") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Inomgårdsutrustning") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Insatsplan") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Lagring") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Motordrivna_fordon") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Släckutrustning") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Torkfläktar") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Uppvärmning") = True Or
        ThisDocument.Bookmarks.Exists("Rutin_Utrymning") = True) Then
    UserForm1.OB_Verksamhet_Lantbruk.Visible = True
        Else
        UserForm1.OB_Verksamhet_Lantbruk.Visible = False
        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
  •