Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have two sheets, In sheet 1 column A is full of numbers, I want to delete
all the lines in sheet 2 where column B does not match any number in Sheet 1 column A. I am currently using the following code for another aapplication, if you could modify this it would help me understand what I am doing a little better Dim rng As Range Dim i As Long Set rng = ActiveSheet.Range(Cells(1, "DL"), Cells(Rows.Count, "DL").End(xlUp)) 'Work backwards from bottom to top when deleting rows With rng For i = .Rows.Count To 1 Step -1 If Not Trim(.Cells(i)) = Trim(UserForm7.TextBox1) Then .Cells(i).EntireRow.Delete End If Next i End With Thank you |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lookup Formula: Return 1st match, then 2nd match, then 3rd match | Excel Discussion (Misc queries) | |||
index(match) Wind Uplift Calculations (match four conditions) | Excel Worksheet Functions | |||
MATCH Multiple Criteria & Return Previous / Penultimate Match | Excel Worksheet Functions | |||
Lookup? Match? pulling rows from one spreadsheet to match a text f | Excel Worksheet Functions | |||
searching a list box for a filename match...and highlighting the match | Excel Programming |