Application defined error

Posted on 2011-03-15
Last Modified: 2012-06-27

the attached piece of code is failing on the line

  .Range("J2").Formula = "=IF(ISERR(I3-F2),"""",I3-F2))"

Its saying

Application defined or Object defined error

This is in the VB editor, can anyone see what is wrong with the forumula?

Sub FillFormula()

Dim r As Long

With Sheets("Pay Rec Data")
    r = .Range("A" & Rows.Count).End(xlUp).Row
    .Range("D2").Formula = "=IF(B2=""entered"",""Yes"",IF(B2="""","""",""No""))"
    .Range("E2").Formula = "=IF(D2=""Yes"",MID(C2,4,10),"""")"
    .Range("F2").Formula = "=IF(D2=""Yes"",RIGHT(C2,8),"""")"
    .Range("G2").Formula = "=IF(B2=""left at"",""Yes"",IF(B2="""","""",""No""))"
    .Range("H2").Formula = "=IF(D2=""No"",C2,"""")"
    .Range("I2").Formula = "=IF(D2=""No"",C2,"""")"
    .Range("J2").Formula = "=IF(ISERR(I3-F2),"""",I3-F2))"
    .Range("K2").Formula = "=J2"
    .Range("L2").Formula = "=IF(A2=""travseam"",""Seamus Travers"","""")"
    .Range("D2:L2").Copy .Range("D2:L" & r)
End With

End Sub

Open in new window

Question by:Seamus2626
LVL 39

Accepted Solution

nutsch earned 500 total points
ID: 35139624
one parenthesis too many

  .Range("J2").Formula = "=IF(ISERR(I3-F2),"""",I3-F2)"


Author Closing Comment

ID: 35139912
Thanks Thomas!

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel 2016 Hiding Toolbars 7 23
Formula to convert ranked data 2 11
TT Formula Check 9 11
Excel Formula Unlimited IF's 6 0
A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now