Hi all,
I am in need of a VBA code to be able to autofill this formula "=IF(ISNUMBER(--MID($B:$B,SEARCH("241",$B:$B),3)),MID($B:$B,18,10),0)" into column D anytime datat is inputted, this is an attempt to limit the amount of formula's are in the sheet as i dont want to have to copy the formula each time or have a long amount of cells with formula that arent needed, i tried this formula that i found on another thread but it doesnt work
Sub Ratio_BC()
Dim Lastrow As Long
Application.ScreenUpdating = False
Lastrow = Range("B" & Rows.Count).End(xlUp).Row
Range("D2").Formula = "=IF(ISNUMBER(--MID($B,SEARCH("241",$B),3)),MID($B,18,10),0)"
Range("D2").AutoFill Destination:=Range("D2:D" & Lastrow)
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
any help would be appreciated
I am in need of a VBA code to be able to autofill this formula "=IF(ISNUMBER(--MID($B:$B,SEARCH("241",$B:$B),3)),MID($B:$B,18,10),0)" into column D anytime datat is inputted, this is an attempt to limit the amount of formula's are in the sheet as i dont want to have to copy the formula each time or have a long amount of cells with formula that arent needed, i tried this formula that i found on another thread but it doesnt work
Sub Ratio_BC()
Dim Lastrow As Long
Application.ScreenUpdating = False
Lastrow = Range("B" & Rows.Count).End(xlUp).Row
Range("D2").Formula = "=IF(ISNUMBER(--MID($B,SEARCH("241",$B),3)),MID($B,18,10),0)"
Range("D2").AutoFill Destination:=Range("D2:D" & Lastrow)
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
any help would be appreciated