Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm trying to set a macro so that if a person changes something in column D on any row it automatically adds the formula in the corresponding cell in Row E to do the maths. This is to make it more idiot proof so if somebody adds a row etc. it sorts out the formula when they start filling in. But the below now gives me the above error code and "Application-defined or Object-defined error" message. I have other macros in the excel spreadsheet as well.... Help! Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Range(Target.Address), Range("A:E")) _ Is Nothing And Target.Row < 1 Then Dim r As Long r = Target.Row If Cells(r, "D").Value < "" Then ' the below adds in the formula in column E 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 | |||
how do I correct a "run time error 1004-unable to open" problem? | Excel Programming | |||
"run-time error '1004' - select method of range failed" | Excel Programming | |||
Run-time error "1004" Select method of range class failed | Excel Discussion (Misc queries) | |||
Run time error 1004: "No list was found.." | Excel Programming | |||
"Run-time error '1004'" Method 'Range' of object '_global' failed. | Excel Programming |