Results 1 to 7 of 7

VBA compilation error : expected expression error

Threaded View

  1. #1
    Registered User
    Join Date
    07-20-2010
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    8

    VBA compilation error : expected expression error

    Hi All,

    I have been working on VB and I am getting a compilation error in a particular code.

    I am trying to use Vlookup to get the data from an array which is in another worksheet, I am able to get the data using the below formula and it is working fine.

    Range("E19:E58").Value = WorksheetFunction.VLookup(Range("B19:B58"), Worksheets("Placeholder").Range("C2:F202"), 2, False)

    But, I am getting #N/A error, So I have been trying to use ISNA function in the VB, but it is showing the compilation error - Expected: expression. Please help.

     Range("E4:E17").Value = IF(ISNA(WorksheetFunction.VLookup(Range("B4:B17"), Worksheets("Placeholder").Range("C2:F202"), 2, False)),0,WorksheetFunction.VLookup(Range("B4:B17"), Worksheets("Placeholder").Range("C2:F202"), 2, False))
    And I am getting the error at the IF statement!!!
    Last edited by raknahs; 07-20-2010 at 11:44 PM. Reason: more info

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1