ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with script. Join values in helper column and run routine. (https://www.excelbanter.com/excel-programming/409046-help-script-join-values-helper-column-run-routine.html)

Sinner

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


All times are GMT +1. The time now is 06:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com