InputBox value within Index;Match formula - not working

Rathmann

New Member
Joined
Nov 4, 2016
Messages
6
Hi,

I have an issue regarding the Index;Match formula. The idea of the macro is to update the formula for some cells which are dependent on which sheet the user wish to do the measurements for. The macro looks like this:

Code:
Sub ReportTest4_FormulaUpdate()


ChooseYourSheet = InputBox("Please type sheetname for this combination", "Choose Sheet")


Worksheets("Report").Range("A2").Formula = "='" & ChooseYourSheet & "'!J1"
Worksheets("Report").Range("B2").Formula = "='" & ChooseYourSheet & "'!D3"
Worksheets("Report").Range("C2").Formula = "='" & ChooseYourSheet & "'!D4"
Worksheets("Report").Range("H2").Formula = "='" & ChooseYourSheet & "'!S10"
Worksheets("Report").Range("G2").Formula = "=INDEX('" & ChooseYourSheet & "'!P:P;MATCH('Raport'!H2;'" & ChooseYourSheet & "'!Q:Q;0))"
Worksheets("Report").Range("F2").Formula = "=INDEX('" & ChooseYourSheet & "'!O:O;MATCH('Raport'!H2;'" & ChooseYourSheet & "'!Q:Q;0))"
Worksheets("Report").Range("E2").Formula = "=INDEX('" & ChooseYourSheet & "'!K:K;MATCH('Raport'!H2;'" & ChooseYourSheet & "'!Q:Q;0))"


End Sub

The issue is the three lines containing the inde;match formula. The first four lines runs perfectly.

I am in need of some help here.. Please

Best Regards,
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Just noticed that in those three lines it says raport and not report, but i corrected this and it is still the same issue.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,186
Members
452,615
Latest member
bogeys2birdies

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