HI all
I want to insert IFERROR. IFERROR cell will blank ""
Into this bit of the code
.Formula = "=IF(B6<>"""",B6,INDEX(H$6:H$355,ROWS(M$6:M6)-COUNTA(B$6:B$355)))&"""""
I tried but gives me an syntax error! many thanks in advance
Private Sub Worksheet_Change(ByVal Target As Range)
Dim oldcell As Variant
Dim StartTime As Double
Dim SecondsElapsed As Double
StartTime = Timer
oldcell = ActiveCell.Address
If Target.Column > 1 And Target.Column < 7 Or Target.Column > 7 And Target.Column < 12 Then
With Range("M6:Q355")
'IF ERROR FORMULAE NEEDS TO BE ADDED!
.Formula = "=IF(B6<>"""",B6,INDEX(H$6:H$355,ROWS(M$6:M6)-COUNTA(B$6:B$355)))&"""""
.Value = .Value
End With
Range("O6:O355").NumberFormat = "mmm-yy"
Range("Q6:Q355").NumberFormat = "mmm-yy"
'Determine how many seconds code took to run
SecondsElapsed = Round(Timer - StartTime, 2)
'Notify user in seconds
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
End If
End Sub
Bookmarks