Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Me again....
I'm using the below to insert a formula into column E if the corresponding column D value is changed.... so far so good. However, if the user inserts a line it gives a "Run-time error 13: type mismatch" and highlights the "If Len(Target....." section of the macro... Any ideas how to fix it? Sub Worksheet_Change(ByVal Target As Range) Dim r As Long If Not Intersect(Range(Target.Address), Columns("D:D")) _ Is Nothing And Target.Row 5 Then r = Target.Row If Len(Target.Value) 0 Then Cells(r, "E").FormulaR1C1 = "=IF(IF(RC[-1]="""",RC[-2],RC[-1])=0,"""",IF(RC[-1]="""",RC[-2],RC[-1]))" End If End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cant insert column get error message | Excel Worksheet Functions | |||
Error message in macro to insert new row? | Excel Discussion (Misc queries) | |||
replace VBA run-time error message with custom message | Excel Programming | |||
Getting error message when I try to insert rows. | Excel Discussion (Misc queries) | |||
Error message when trying to insert a column | Excel Discussion (Misc queries) |