2016年9月26日星期一

delete row if criteria not met over two columns [Anwsered]

delete row if criteria not met over two columns

If the single letter "C" or a "DU" is not found in either column Dor E, delete the entire row if data is present. 
Column may contain one letter, words, or numbers.

Anwsers to the Problem delete row if criteria not met over two columns

Download SmartPCFixer for Free Now

That's what this should do:
Sub DelteRows2()
    Dim lnLastRow As Long, lnFirstRow As Long, lnMarkerCol As Long, i As Long
    Dim rng As Range
   
    '##################################
    '### SET FIRST ROW OF DATA HERE ###
    lnFirstRow = 2
    '##################################
   
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    Application.EnableEvents = False
   
     'Get the column number of the next blank column on the sheet:
    lnMarkerCol = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByColumns, _
        SearchDirection:=xlPrevious, LookIn:=xlFormulas).Column + 1
   
     'Get row number of last cell containing data:
    lnLastRow = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByRows, _
        SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row
   
    Set rng = Range(Cells(lnFirstRow, lnMarkerCol), Cells(lnLastRow, lnMarkerCol))
   
     'Put the following formula in the marker column:
     ' =IF(OR(D2="C",E2="C",D2="DU",E2="DU"),1,"")  (where 2 is the first row specified above)
    rng(1, 1).Formula = "=IF(OR(D" & lnFirstRow & "=""C"",E" & lnFirstRow & "=""C"",D" _
        & lnFirstRow & "=""DU"",E" & lnFirstRow & "=""DU""),1,"""")"
   
     'Fill down the range:
    rng.FillDown
   
     'Calculate the range:
    rng.Calculate
   
     'Delete the rows with cells NOT CONTAINING 1 in the marker column:
    For i = lnLastRow To lnFirstRow Step -1
        If Cells(i, lnMarkerCol).Value <> 1 Then Rows(i).Delete
    Next i
   
     'Delete the marker column:
    Columns(lnMarkerCol).Delete
   
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True
    Application.EnableEvents = True
End Sub

  • Download the Microsoft Windows ISO (installation device) from the following website:
  • http://www.microsoft.com/en-us/software-download/windows10
  • Users must select the appropriate ISO, either 32 bit or 64 bit, depending upon their individual computer.
  • Extract the ISO file to a separate USB device or burn the program to a compact disc.
  • Run the Microsoft Windows 10 upgrade directly from the software that you have thus created.

Another Safe way to Fix the Problem: delete row if criteria not met over two columns:

How to Fix delete row if criteria not met over two columns with SmartPCFixer?

1. Click the button to download Error Fixer . Install it on your system.  Open it, and it will perform a scan for your system. The errors will be shown in the list.

2. After the scan is finished, you can see the errors and problems need to be repaired. Click Fix All.

3. When the Fixing part is done, your computer has been speeded up and the errors have been removed


Related: How to Update & Download NVidia GeForce 6100/nForce 420 WHQL Certified driver v.178.13,How to Update & Download NVidia GeForce 7600 GS Video Driver v.295.75 Certified,How Can I Update & Download NVidia GeForce 820M Driver v.344.48 WHQL,[Solved] Download NVidia GeForce GTX 560M VGA Driver v.296.17 Certified,Way to Update & Herunterladen NVidia GeForce GT 130M Video Treiber v.295.75 Certified,How to Update & Download SONY SVE14A1X1RH Realtek Ethernet Driver,Where to Download SONY SVS13A2W9ES Bluetooth Driver (Intel) v.2.6 - 2.6.23.40059,Best Way to Update & Download SONY VGN-CR203E Conexant HDAUDIO SoftV92 Data Fax Modem with SmartCP Setup Program v.7.62.0.50 driver,Best Way to Download SONY VGN-FE790G/N Wireless LAN Driver v.10.6.0.29,Method to Update & Download SONY VGN-NR31Z/S Firmware Extension Parser Device v.8.0.2.3,How to Fix Error 0x0000c1f5 Solución?,Error 0x80071a91 Win7 Fix Patch,Error 0x800ccc60 Windows Live Mail [Solved],Error Message 0x800ccc79 Outlook 2000 Fix,What is Error 0xc1ab0001?,[Answered] x64 saplugin dll,How to Fix Problem - Kb943729 Download?,Troubleshooting: Bccode D1 Error,Java Runtime Tech Support,Troubleshooting: ERROR NO SUCH GROUP Error
Read More: Troubleshooting:Deleted emails do not show up in imap.aol.com \"Deleted Items\" folder.,[Anwsered] Defragment a Win 7 Pro C drive,Tech Support: Delete windows off spare drive,Fast Solution to Problem: Data Execution Prevention Trouble,How to Fix - Custom views disabled?

没有评论:

发表评论

注意:只有此博客的成员才能发布评论。