Results 1 to 4 of 4

Thread: Solve Block If Without End If Problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    is this what you wanted

    Code:
    Sub SLA_ID()
    
        Dim Classification As String, class As String, volume As Integer, netWDay As Integer, classification2 As Integer
        
        Classification = Range("F2:F500").Value
        volume = Range("J2:J500").Value
        netWDay = Range("AH2:AH500").Value
        
        If ((Classification = "Reorganization" & netWDay <= 5)) Then
            classification2 = "Within SLA"
        Else
            Classification = "Beyond SLA"
        End If
        
        If ((Classification = "CR" & netWDay = 1)) Then
            classification2 = "Within SLA"
        Else
            Classification = "Beyond SLA"
        End If
        
        If ((Classification = "Other Forms" & netWDay <= 1)) Then
            classification2 = "Within SLA"
        Else
            Classification = "Beyond SLA"
        End If
        
        If ((Classification = "MMR" & volume <= 30)) Then
            class = "MMR_Low"
        Else
            Classification = "MMR_High"
        End If
        
        If ((class = "MMR_Low" & netWDay <= 2)) Then
            classification2 = "Within SLA"
        Else
            Classification = "Beyond SLA"
        End If
        
        If ((class = "MMR_High" & netWDay <= 5)) Then
            Classification = "Within SLA"
        Else
            Classification = "Beyond SLA"
            Range("AM2:AM500").Value = class
            Range("AL2:AL500").Value = classification2
        End If
    
    
    End Sub
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Banned
    Join Date
    May 2013
    Posts
    17
    Rep Power
    0
    Runtime Error '13': Type mismatch is the problem. I don't know why. I have already double checked the codes. Please help! _

Similar Threads

  1. Replies: 8
    Last Post: 05-21-2013, 06:34 AM
  2. VBA - Find Last End Value
    By ivandgreat in forum Excel Help
    Replies: 3
    Last Post: 05-02-2013, 10:37 AM
  3. Start & End Number Further Converted
    By ayazgreat in forum Excel Help
    Replies: 32
    Last Post: 05-06-2012, 11:39 PM
  4. Remove only numeric value in the end of any string
    By LalitPandey87 in forum Excel Help
    Replies: 3
    Last Post: 04-08-2012, 09:39 AM
  5. Formatting Problem while copying data
    By princ_wns in forum Excel Help
    Replies: 3
    Last Post: 04-03-2012, 07:18 PM

Tags for this Thread

Posting Permissions

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