Solved

Application defined error

Posted on 2011-03-15
2
190 Views
Last Modified: 2012-06-27
Hi,

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?

Thanks
Seamus
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

0
Comment
Question by:Seamus2626
2 Comments
 
LVL 39

Accepted Solution

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

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

T
0
 

Author Closing Comment

by:Seamus2626
ID: 35139912
Thanks Thomas!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

830 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