Results 1 to 4 of 4

multi-line VBA not working after column order change

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    multi-line VBA not working after column order change

    I changed the order and now the below line of code does not seem to work when the VBA is run. I attached the workbook as well. Thanks.


     For iRow = 2 To rData.Rows.Count
            With rData.Rows(iRow)
                If .Cells(iGender).Value = "Male" And .Cells(iInheritance).Value = "x-linked dominant" And .Cells(iPopFreqMax).Value <= 0.01 And .Cells(iClinvar).Value = "" And .Cells(iCommon).Value = "" Then .Cells(iClassification).Value = "likely pathogenic"
                If .Cells(iGender).Value = "Female" And .Cells(iInheritance).Value = "x-linked recessive" And .Cells(iPopFreqMax).Value <= 0.1 And .Cells(iClinvar).Value = "" And .Cells(iCommon).Value = "" Then .Cells(iClassification).Value = "likely pathogenic"
                If .Cells(iGender).Value = "Male" And .Cells(iInheritance).Value = "x-linked dominant" And .Cells(iPopFreqMax).Value >= 0.01 And .Cells(iClinvar).Value = "" And .Cells(iCommon).Value = "" Then .Cells(iClassification).Value = "likely benign"
                If .Cells(iGender).Value = "Female" And .Cells(iInheritance).Value = "x-linked recessive" And .Cells(iPopFreqMax).Value >= 0.1 And .Cells(iClinvar).Value = "" And .Cells(iCommon).Value = "" Then .Cells(iClassification).Value = "likely benign"
                If .Cells(iGender).Value = "Male" And .Cells(iInheritance).Value = "x-linked dominant" And .Cells(iPopFreqMax).Value <= 0.01 And .Cells(iClinvar).Value = "" And .Cells(iCommon).Value = "common" Then .Cells(iClassification).Value = "???"
                If .Cells(iGender).Value = "Female" And .Cells(iInheritance).Value = "x-linked recessive" And .Cells(iPopFreqMax).Value <= 0.1 And .Cells(iClinvar).Value = "" And .Cells(iCommon).Value = "common" Then .Cells(iClassification).Value = "???"
                
                If .Cells(iClassification).Value = "likely pathogenic" Then .Cells(iClassification).EntireRow.Interior.ColorIndex = 7 'Magenta
                If .Cells(iClassification).Value = "likely benign" Then .Cells(iClassification).EntireRow.Interior.ColorIndex = 8 'Cyan
                If .Cells(iClassification).Value = "???" Then .Cells(iClassification).EntireRow.Interior.ColorIndex = 22 'Pink
    
            End With
        Next iRow
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Setting individual column width sizes for multi column listbox with VB2011 Mac not working
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 01-26-2014, 06:19 PM
  2. [SOLVED] VBA to detect change in order number, then add a value to each 1st line of that order
    By Marijke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2013, 09:19 AM
  3. Replies: 10
    Last Post: 09-27-2012, 03:59 PM
  4. [SOLVED] Change order in a multi-shape group?
    By Jay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2006, 06:45 PM
  5. [SOLVED] How do I change multi-line entries to single line entries in Exce.
    By CPOWEREQUIP in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2005, 08:06 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