Consulting

Results 1 to 4 of 4

Thread: Solved: Index match with command button

  1. #1
    VBAX Contributor
    Joined
    May 2007
    Posts
    128
    Location

    Solved: Index match with command button

    Dear Experts

    For index match, I am using following function, this works fine
    PHP Code:
    =INDEX(Party!$B$2:$B$250,MATCH(Rpt_Daily!C6,Party!$A$2:$A$250,0)) 
    source sheet=Party
    Target Sheet=rpt_daily

    Question-1

    How to use above formula with command button.

    I mean while pressing commandbutton, sheets("rpt_daily") must updated with sheets("Party")

    Question-2

    How to use above fourmat with offset() funciton?

    Please help

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Simple way

    [vba]

    Activecell.Value = ACtivesheet.Evaluate( _
    "=INDEX(Party!$B$2:$B$250,MATCH(Rpt_Daily!C6,Party!$A$2:$A$250,0))")
    [/vba]

    What do you want to Offset?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    May 2007
    Posts
    128
    Location
    Dear Sir,

    My I could not explain my problem?
    So please see attachment and help me again

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You certainly did not

    [vba]

    Private Sub CommandButton1_Click()
    Dim iLastRow As Long
    Dim i As Long

    iLastRow = Me.Cells(Me.Rows.Count, "A").End(xlUp).Row
    For i = 6 To iLastRow
    Me.Cells(i, "D").Value = Me.Evaluate( _
    "=INDEX(Party!$B$2:$B$250,MATCH(" & Me.Cells(i, "C").Address & ",Party!$A$2:$A$250,0))")
    Next i
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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