Results 1 to 8 of 8

Thread: Control strings

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4

    Control Strings

    Quote Originally Posted by albe.btz View Post
    Hi Douglas,

    let me see if i got it right, this is my current code:

    Sub breakSeasonality()
    
    Dim DayCount
    Dim My_Range As Range
    Dim Ceiling_Range As Range
    Dim CellaCerc
    Sheets("GANNT").Activate
    Set My_Range = Sheets("GANNT").Range("A1")
    Sheets("EXPANDED PERIODS").Activate
    Set Ceiling_Range = Sheets("EXPANDED PERIODS").Range("A1")
    Do While My_Range.Offset(1, 0) <> ""
        Set My_Range = My_Range.Offset(1, 0)
        For DayCount = 1 To My_Range.Offset(0, 12)
            Set Ceiling_Range = Ceiling_Range.Offset(1, 0)
            'Ceiling_Range.Select
            Ceiling_Range = My_Range.Offset(0, 9) + DayCount - 1
            Ceiling_Range.Offset(0, 1) = "TBD" ' QF SEASONAL
            For Each CellaCerc In Sheets("Key Criteria").Range("A2", "A23")
                If (((My_Range.Offset(0, 9) + DayCount - 1) >= CellaCerc.Offset(0, 1)) And ((My_Range.Offset(0, 9) + DayCount - 1) <= CellaCerc.Offset(0, 2))) Then
                    Ceiling_Range.Offset(0, 1) = CellaCerc
                    Exit For
                End If
            Next
            Ceiling_Range.Offset(0, 2) = My_Range.Offset(0, 1) ' ORI
            Ceiling_Range.Offset(0, 3) = My_Range.Offset(0, 2) ' DEST
            Ceiling_Range.Offset(0, 4) = My_Range.Offset(0, 0) ' CXR
            Ceiling_Range.Offset(0, 5) = My_Range.Offset(0, 3) ' Fare Basis
            Ceiling_Range.Offset(0, 6) = My_Range.Offset(0, 4) ' RBD
            Ceiling_Range.Offset(0, 7) = My_Range.Offset(0, 5) ' CLASS
            Ceiling_Range.Offset(0, 8) = My_Range.Offset(0, 6) ' LEVEL
            Ceiling_Range.Offset(0, 9) = My_Range.Offset(0, 7) ' TFC
            Ceiling_Range.Offset(0, 10) = My_Range.Offset(0, 8) ' AIF
        Next
    Loop
    End Sub
    Where would you insert your fixes?

    cheers and thank you

    I tried to change do while and loop but when it finds a row with the current situations it crashes:

    CXR ORI DEST Fare basis RBD Class Level TFC AIF Start Travel Date End Travel Date Sale End Date Duration
    CX LON AKL KLARRGB8 K Y 1279 226 1504.5 expired expired 31/03/2019 null



    that was the purpose of my thread: finding a solution to skip these lines
    Last edited by albe.btz; 08-23-2017 at 08:13 AM. Reason: correction

Posting Permissions

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