Index, Match, ActiveCell. Row confusion

Andywal

New Member
Joined
Jan 20, 2018
Messages
8
Hi All

I need to return to my current worksheet, Say 'Sheet1' , the value in a matrix on a different worksheet, Say 'Sheet 10' by using, I assume, Index, Match,Match lookup formula.

This is complicated by the fact that the values to use for reference for the Index are on 'Sheet1' - Column= 'G' - Row= Activecell.Row and Column= 'H' - Row= Activecell.Row

The result must be returned to 'Sheet1' Column='J' - Row= Activecell.Row

I am totally confused by all the references and shoehorning them into an Index formula.

Is there a simple way to do this?

Any thoughts would be much appreciated

Andy.
 
Try this.
Code:
Dim rngMatrix As Range

    Set rngMatrix = Sheets("Cas 1").Range("C22:P36")

    With ActiveCell
        Range("J" & .Row).Value = Application.Index(rngMatrix, Application.Match(Range("H" & .Row), rngMatrix.Columns(1), 0), Application.Match(Range("I" & .Row), rngMatrix.Rows(1), 0))
    End With
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi Norie
Got it sorted.
I changed the References For [MyWidth] and [MyHeight] as below to give the values and it now all works perfectly.

Code:
    MyCell = "J" & ActiveCell.Row
    MyWidth = Range("G" & ActiveCell.Row)
    MyHeight = Range("H" & ActiveCell.Row)
    Range(MyCell) = WorksheetFunction.Index(Worksheets("Cas 1").Range("C22:P36"), WorksheetFunction.Match(MyHeight, Worksheets("Cas 1").Range("C22:C36"), 0), WorksheetFunction.Match(MyWidth, Worksheets("Cas 1").Range("C22:P22"), 0))
Many thanks for your help.

Andy.
 
Upvote 0

Forum statistics

Threads
1,223,970
Messages
6,175,702
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top