Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Application defined error

Posted on 2011-03-15
2
Medium Priority
?
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

597 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