Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
re : Help needed on some codes
Hi Experts, Attached below is the code that I used to delete the rows that do not have the cell values found in rng2 Dim Rngva As Range Dim rCellva As Range Dim delRngva As Range Dim CalcModeva As Long Set WB1 = Workbooks("DCR Template Daily") Set SH1 = WB1.Sheets("Raw") Set SH2 = WB1.Sheets("Selections") Set rng1 = SH1.Columns("D:D") Set rng2 = SH2.Range("C17") With Application CalcModeva = .Calculation Calculation = xlCalculationAutomatic ScreenUpdating = False End With For Each rCellva In rng1.Cells If rCellva.Value < rng2 Then If delRngva Is Nothing Then Set delRngva = rCellva Else Set delRngva = Union(rCellva, delRngva) End If End If Next rCellva If Not delRngva Is Nothing Then delRngva.EntireRow.Delete Else 'nothing found, do nothing End If With Application Calculation = CalcModeva ScreenUpdating = False End With My question is, if now i want to delete the rows that the cells values are equal to rng2, how and where should be edited in the code??? AJ -- dic09 ------------------------------------------------------------------------ dic09's Profile: http://www.excelforum.com/member.php...o&userid=36223 View this thread: http://www.excelforum.com/showthread...hreadid=560147 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Codes needed to copy same one row from more than 300 Excel files | Excel Discussion (Misc queries) | |||
2 codes in 1 | Excel Discussion (Misc queries) | |||
Zip Codes | New Users to Excel | |||
Codes | Excel Discussion (Misc queries) | |||
Help with codes please!! | Excel Discussion (Misc queries) |