hello
I try design a simple macro to auto fill the formula in COL B from B4 to lastrow contains value but it gives me error "Application-defined or Object-defined error"
in line of the formula
but the formula works normally if I write inside the cell
so any suggestion to correct this error
Sub n()
With ThisWorkbook.Sheets("Sheet1")
lr = Range("a" & Rows.Count).End(xlUp).Row
With Range("b4:b" & lr)
.Formula = "=TRIM(MID(SUBSTITUTE(a4,"",REPT("",100)),100,100))"
.Value = .Value
End With
End With
End Sub