Here is another macro you can consider...
Code:Sub Test() Dim LastRow As Long LastRow = Cells(Rows.Count, "E").End(xlUp).Row Range("F1:F" & LastRow) = Evaluate(Replace("IF(E1:E#=0+MID(H1:H#,2,99),1,E1:E#)", "#", LastRow)) End Sub
Here is another macro you can consider...
Code:Sub Test() Dim LastRow As Long LastRow = Cells(Rows.Count, "E").End(xlUp).Row Range("F1:F" & LastRow) = Evaluate(Replace("IF(E1:E#=0+MID(H1:H#,2,99),1,E1:E#)", "#", LastRow)) End Sub
Bookmarks