Results 1 to 9 of 9

Multiple Conditions with If Statements in VBA

Threaded View

  1. #1
    Registered User
    Join Date
    02-09-2016
    Location
    Marietta, GA
    MS-Off Ver
    2013
    Posts
    17

    Multiple Conditions with If Statements in VBA

    Sample Workbook.xlsx

    I'm new to VBA and coding in general. I have tried to combine bits and pieces of others' code I found online to create a macro that will look through 3 different columns and if all the conditions exist, eliminate the row where all three conditions are true. (Condition 1 is C2= "Ready"; Condition 2 is H2 = "Clinical"; Condition 3 is D2 does not equal "Tech Start")

    Below is the code I've currently got, but it isn't working.
    Sub EliminateTechTesting()
    'Identifies the Lines with clinical techs choosing any status other than tech start
    Dim LR As Long, i As Long
    LR = Range("C" & Rows.Count).End(xlUp).Row
    LR = Range("D" & Rows.Count).End(xlUp).Row
    LR = Range("H" & Rows.Count).End(xlUp).Row
    For i = LR To 1 Step -1
    If Range("C2" & i).Value = "Ready" And Range("H2" & i).Value = "Clinical" And Range("D2" & i).Value <> "Tech Start" Then Rows(i).Delete
    Next i
    End Sub

    Any help would be very, very much appreciated.
    Last edited by GSU1972; 03-21-2016 at 03:07 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Syntax for formula that uses multiple conditions inside of multiple IF statements
    By njmiller31 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2013, 11:55 AM
  2. multiple if statements/conditions syntax
    By kamelkid2 in forum Excel General
    Replies: 3
    Last Post: 01-13-2011, 10:18 AM
  3. [SOLVED] If Statements / Multiple Possible Conditions
    By jmg81485 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2010, 02:52 AM
  4. Replies: 12
    Last Post: 05-15-2009, 08:38 AM
  5. Multiple conditions in nested IF statements
    By havfunonline2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-09-2009, 05:36 AM
  6. If statements with multiple conditions
    By afathi in forum Excel General
    Replies: 4
    Last Post: 04-22-2008, 04:30 PM
  7. IF Statements, Multiple Conditions
    By DiamondCutter in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-21-2005, 11:25 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1