Macro to Open Correct Worksheet

Mrs. Robinson

New Member
Joined
Aug 6, 2010
Messages
7
I run a weekly macro that formats one of 52 worksheets based on information from another worksheet...appropriately named Wk 1, Wk 2, etc. Right now I use VLookup to get the data but would like to incorporate that into the macro. Is there a way to replace "Wk 33" (see below) so that I don't have to adjust the macro each week? If it helps, the Sheet #'s are also in numerical order, i.e. Sheet 1 is Wk 1, Sheet 2 is Wk 2, etc.

=VLOOKUP(B109,'[Approved vacation.xls]Wk 33'!$B$18:$F$94,5,FALSE)

Thanks,
Diana
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,214,561
Messages
6,120,239
Members
448,951
Latest member
jennlynn

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