View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sinner Sinner is offline
external usenet poster
 
Posts: 142
Default Help with script. Join values in helper column and run routine.


Hi,

How can I use the below script to join values in column L&J in helper
column 'columnM', then run the routine on columnM. At the end delete
columnM.
-------------------------------------------------
Sub Trimmer()
Worksheets("Data").Select
Range("a2").Select
firstRowFound = True
LastRow = Cells(Rows.Count, "j").End(xlUp).Row + 1
For i = 2 To LastRow
If IsError(Application.Match(Range("j" & i), _
Range("Susers"), 0)) Then
If firstRowFound = True Then
Rows(i).Select
firstRowFound = False
Else
Union(Selection, Rows(i)).Select
End If
End If
Next i
Selection.Delete Shift:=xlShiftUp
Columns.AutoFit
Range("L2").Select

End Sub