Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Mar 31, 6:51 pm, JE McGimpsey wrote:
One way: No need to trim that I can see. Dim vArr As Variant Dim rCell As Range Dim rDelete As Range Dim nLow As Long Dim nHigh As Long Dim i As Long Dim sTest As String With Sheets("Sheet1") vArr = .Range(.Cells(1, 1), _ .Cells(.Rows.Count, 1).End(xlUp)).Value End With nLow = LBound(vArr, 1) nHigh = UBound(vArr, 1) With Sheets("Sheet2") For Each rCell In .Range(.Cells(1, 1), _ .Cells(.Rows.Count, 1).End(xlUp)) sTest = rCell.Text For i = nLow To nHigh If sTest = vArr(i, 1) Then If rDelete Is Nothing Then Set rDelete = rCell Else Set rDelete = Union(rDelete, rCell) End If End If Next i Next rCell If Not rDelete Is Nothing Then rDelete.EntireRow.Delete End With In article .com, "Sinner" wrote: I have the following code for deleting pins found in a list in "column 1" of "sheet1" from list in "column 1" of "sheet 2" with the list tagged in other columns, leaving behind updated & reconciled dataset in sheet 2.- Hide quoted text - - Show quoted text - Dear I have placed your script after a button. I need to have an error message if any of the two sheets is empty like "List unavailable. Input list.". Thx JE McGimpsey, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting rows with 11+ characters. | Excel Discussion (Misc queries) | |||
Deleting rows based on number of characters | Excel Discussion (Misc queries) | |||
Deleting characters that are not numbers | Excel Discussion (Misc queries) | |||
Deleting Blank Characters in a Cell | Excel Discussion (Misc queries) | |||
Deleting 3 Text characters from the right | Excel Worksheet Functions |