Results 1 to 20 of 72

Thread: IF statment nested within VBA Code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #18
    VBAX Regular
    Joined
    Sep 2023
    Posts
    77
    Location
    Hi Paul,

    That makes sense to rename them, I've renamed them now for ease of reference.

    Your code is complete but I need to insert it into my code without breaking the rest/flow of the code, I have inserted as per below but nothing happened when I select 'Genoa to New York' or 'Genoa to Los Angeles'.

    Basically the check boxes are only needed for 'Genoa to New York' and then will be hidden for the rest, if I can get the below two to work correctly, I can then replicate for the other lanes.

    Case "Ocean_EU_to_US" & "#" & "Genoa to New York"    Range("A51:A74").EntireRow.Hidden = False
        Range("A23:A25").EntireRow.Hidden = False
        Range("A54:A57").EntireRow.Hidden = True
        ActiveSheet.Shapes("RFR20").Visible = True
        ActiveSheet.Shapes("RFR40").Visible = True
        ActiveSheet.Shapes("RFR40HQ").Visible = True
        ActiveSheet.Shapes("Priority20").Visible = True
        ActiveSheet.Shapes("Priority40").Visible = True
        ActiveSheet.Shapes("Priority40HQ").Visible = True
        
    Case "Ocean_EU_to_US" & "#" & "Genoa to Los Angeles"
        Range("A51:A74").EntireRow.Hidden = False
        Range("A23:A25").EntireRow.Hidden = False
        Range("A54:A57").EntireRow.Hidden = True
        ActiveSheet.Shapes("RFR20").Visible = False
        ActiveSheet.Shapes("RFR40").Visible = False
        ActiveSheet.Shapes("RFR40HQ").Visible = False
        ActiveSheet.Shapes("Priority20").Visible = False
        ActiveSheet.Shapes("Priority40").Visible = False
        ActiveSheet.Shapes("Priority40HQ").Visible = False
    Last edited by Scuba; 09-13-2023 at 02:13 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
  •