Macro to change VLookup Range

RahulNa

Board Regular
Joined
Jul 12, 2012
Messages
124
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I want to update Vlookup range in the report with respect to sheet name in cell A27.

Business Solution

<tbody>
</tbody>
Connect Status
Business Retail

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,4,0)
Business Digital

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,6,0)
Business Corporate

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,7,0)
Technology Retail

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,8,0)
Technology Corporate

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,9,0)

<tbody>
</tbody>

For eg:- Cell A27 have drop down with Aug,Sep,Oct. So if I select Sep then the whole range should change as


Business Solution

<tbody>
</tbody>
Connect Status
Business Retail

<tbody>
</tbody>
=VLOOKUP($B$11,Sep!C:J,4,0)
Business Digital

<tbody>
</tbody>
=VLOOKUP($B$11,Sep!C:J,6,0)
Business Corporate

<tbody>
</tbody>
=VLOOKUP($B$11,Sep!C:J,7,0)
Technology Retail

<tbody>
</tbody>
=VLOOKUP($B$11,Sep!C:J,8,0)
Technology Corporate

<tbody>
</tbody>
=VLOOKUP($B$11,Sep!C:J,9,0)


<tbody>
</tbody>

****** id="cke_pastebin" style="position: absolute; top: 281px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
Business Solution

<tbody>
</tbody>
Connect Status
Business Retail

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,4,0)
Business Digital

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,6,0)
Business Corporate

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,7,0)
Technology Retail

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,8,0)
Technology Corporate

<tbody>
</tbody>
=VLOOKUP($B$11,Oct!C:J,9,0)


<tbody>
</tbody>
</body>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
=vlookup($b$11,indirect($a$27 &"!c:j"),4,0)
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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