PDA

View Full Version : Solved: Index match with command button



tqm1
06-14-2007, 07:01 PM
Dear Experts

For index match, I am using following function, this works fine


=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

Bob Phillips
06-15-2007, 01:53 AM
Simple way



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


What do you want to Offset?

tqm1
06-15-2007, 03:32 AM
Dear Sir,

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

Bob Phillips
06-15-2007, 03:55 AM
You certainly did not



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