+ Reply to Thread
Results 1 to 2 of 2

Can't use If function with Vlookup in userform

Hybrid View

tantcu Can't use If function with... 07-09-2013, 05:49 PM
contracting Re: Can't use If function... 07-09-2013, 06:01 PM
  1. #1
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Can't use If function with Vlookup in userform

    Hello,

    I'm working with userform and consider using the IF + Vlookup statement. If I only use Vlookup function, it worked. However when I combine with IF function, it got wrong. This is What I'm trying to do:

    Cells(7, 3).Value = Application.If(cboPart.Value = "Other Customer", Cells(6, 3).Value, (VLookup(Cells(3, 3).Value, Sheets("FS").Range("A1:AE100"), 2, 0)))
    If you know how to fix it, I really appreaciate

  2. #2
    Registered User
    Join Date
    01-14-2013
    Location
    somewhere. in a building.
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Can't use If function with Vlookup in userform

    The worksheet function If() isn't available to Application.Worksheetfunction; I'm fairly certain that means it isn't available to the application object either. Try this instead.
        If cboPart.Value = "Other Customer" Then
            Cells(7, 3).Value = Cells(6, 3).Value
        Else
            Cells(7, 3).Value = Application.VLookup(Cells(3, 3).Value, Sheets("FS").Range("A1:AE100"), 2, 0)
        End If

+ Reply to Thread

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