Consulting

Results 1 to 9 of 9

Thread: Solved: Vlook up..?

  1. #1
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location

    Solved: Vlook up..?

    Why doesn't the temperature look up work?
    Can anyone help?

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Try[VBA]application.worksheetfunction.vlookup[/VBA]
    Charlize

  3. #3
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    Doesn't work.
    [VBA]Private Sub CTemprature_Change()
    TxtFluidDensity.Value = Application.WorksheetFunction.VLookup( _
    CTemprature.Value, Range("G5:H25"), 2, False)
    End Sub[/VBA].

    Could I let this run over 3 colums,you select temperature and it automatically inserts the density and viscocity?

  4. #4
    VBAX Tutor Erdin? E. Ka's Avatar
    Joined
    Sep 2006
    Location
    Bursa
    Posts
    264
    Location
    Hi Mr.G,

    You should use Val.

    Try this;

    [VBA]Private Sub CTemprature_Change()
    TxtFluidDensity.Text = Application.VLookup( _
    Val(CTemprature.Value), Range("G5:H25"), 2, False)
    End Sub[/VBA]
    Erdin? E. Kara?am | Loves from Bursa city in Republic of T?rkiye

  5. #5
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    That works!!
    Can I link viscocity to that also? It is in ("I5:I25")

  6. #6
    VBAX Tutor Erdin? E. Ka's Avatar
    Joined
    Sep 2006
    Location
    Bursa
    Posts
    264
    Location
    Is it like this?

    [VBA]Private Sub CTemprature_Change()
    TxtFluidDensity.Text = Application.VLookup( _
    Val(CTemprature.Value), Range("G5:I25"), 3, False)
    End Sub[/VBA]
    Erdin? E. Kara?am | Loves from Bursa city in Republic of T?rkiye

  7. #7
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    OK but fluid density is a text box on its own with info in Colum I

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub CTemprature_Change()
    TxtFluidDensity.Text = Application.VLookup( _
    Val(CTemprature.Value), Range("G5:H25"), 2, False)
    TxtViscosity = Format(Application.VLookup( _
    Val(CTemprature.Value), Range("G5:I25"), 3, False), ".000000")
    End Sub
    [/vba]

  9. #9
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    Thanx a lot it works.
    Thank you

Posting Permissions

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