Results 1 to 4 of 4

Thread: VBA - function Vlookup

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Nov 2022
    Posts
    13
    Location

    VBA - function Vlookup

    Hi everyone,
    In my module i pretend search a value corresponding to a variable a.
    But when i run the code variable h are incorrect, because apeear error 2042 and the suppose is appear a number.

    My code is:

    Sub Macro3()
        Dim j As Variant
        Dim a As Variant
        Dim h As Variant 'variavel de teste
        Set Model = Workbooks("AtrasosTotal.xlsm").Worksheets("Model")
        lastRowZModel = Model.Cells(Model.Rows.Count, "A").End(xlUp).Row
        a = 1600104092
        Sheets("Model").Select
        Set b = Range("A2:O" & lastRowZModel)
        h = Application.VLookup(a, b, 12, False)
    End Sub

    How can I resolve this problem
    Last edited by Aussiebear; 03-09-2025 at 01:15 PM. Reason: Added code tags to supplied code

Posting Permissions

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