Chirag R Raval
Member
Dear Sir,
I have a code that insert extra column at data last , which have evaluated as Ttrue or False
based on length of string in particular column. , Auto filter & remove / delete rows , based values have on that extra helper column.
how to achieve same result without insert extra helper column result?
code should target just required column.
hope your little help.
Regards,
Chirag Raval
I have a code that insert extra column at data last , which have evaluated as Ttrue or False
based on length of string in particular column. , Auto filter & remove / delete rows , based values have on that extra helper column.
Code:
Sub StringLengthDelRows()
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = Range("A1").CurrentRegion
Set rng2 = Range(Cells(1, rng1.Columns.Count + 1), Cells(rng1.Rows.Count, rng1.Columns.Count + 1))
ActiveSheet.AutoFilterMode = False
With rng2
.Formula = "=LEN(RC[-" & rng1.Columns.Count & "]:RC[-1])<5"
.FormulaArray = .FormulaR1C1
.Value = .Value
.AutoFilter Field:=1, Criteria1:="TRUE"
.EntireRow.Delete
End With
ActiveSheet.AutoFilterMode = False
End Sub
code should target just required column.
hope your little help.
Regards,
Chirag Raval