I have sheet that needs to pull data based on three variables, the name of the worksheet, a specified column, and the last entry in that column. (if there is an entry in the column there is also an entry in column A)

I have created two different equations but I am stuck on trying to make the selection of the worksheet dynamic. If the name of the worksheet is entered into cell b5 then look at the named worksheet. In this equation the worksheet is 'Moderate!'.

{=OFFSET(Moderate!$A$1,LARGE(IF(Moderate!$A:$A<>"",ROW(Moderate!$A:$A)),1)-1,MATCH($B$5,Moderate!4:4,0)-1)}
{=INDEX(Moderate!A:CM,LARGE(IF(Moderate!$A:$A<>"",ROW(Moderate!$A:$A)),1),MATCH($B$5,Moderate!4:4,0))}
I thought of using indirect but it seems I need a macro for that.

If you have a better way of getting the information I am up for suggestions as well as which formula will be most efficient.

Thanks
Ben