Excel Formula to switch sheets

Finalfight40

Active Member
Joined
Apr 24, 2018
Messages
273
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone

I currently created the formula below which pulls back information from another sheet. However currently it only looks at 1 sheet which would be '28th-29thApr'!$1:$1048576. I was wondering if it was possible to amend this formula so that when i drag this formula to the right, it would select the next sheet rather than the same sheet?

Any help here would be appreciated and thank you in advance.

Code:
=IFERROR(IF(VLOOKUP($A3,[B]'28th-29thApr'!$1:$1048576[/B],MATCH(H$2,[B]'28th-29thApr'!$2:$2[/B],0),FALSE)="X",1,(VLOOKUP($A3,[B]'28th-29thApr'!$1:$1048576[/B],MATCH(H$2,[B]'28th-29thApr'!$2:$2[/B],0),FALSE))), 0)
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You could create a table of sheet names and use INDIRECT(INDEX()) in your formula to get the name of the sheet, but you'd need to update the table if you added more sheet.

Sheet 1
A1 '28th-29thApr'
A2 '30thApr'
A3 '1st-2ndMay'

Youre INDEX would have to be based on COLUMNS() but I cant get it to work at the moment
 
Upvote 0
You could create a table of sheet names and use INDIRECT(INDEX()) in your formula to get the name of the sheet, but you'd need to update the table if you added more sheet.

Sheet 1
A1 '28th-29thApr'
A2 '30thApr'
A3 '1st-2ndMay'

Youre INDEX would have to be based on COLUMNS() but I cant get it to work at the moment

Hi Special-K99

Sorry for the late reply but it was bank holiday over here.

I thought so. I've decided to go for the indirect approach and found a some VBA code which will pull through all sheet names so im going to see if i can use this in a macro.

Thanks for taking the time to answer though.
 
Upvote 0

Forum statistics

Threads
1,223,790
Messages
6,174,594
Members
452,574
Latest member
hang_and_bang

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