Hiding Columns, based on date

dg74

New Member
Joined
Mar 16, 2011
Messages
8
Hi,

Can anyone help me, i'm sure what i need to do is possible, but not sure how.

Basically I have a spreasdheet which has 2 worksheets

one worksheet contains each week end date with a week no

the other sheet contains all 52 weeks of the year in columns, on this sheet is also a week end date.
I want to do a lookup to determine which week of the year it is, then automatically hide the all but 16 of the 52 columns.

Ie if the week end date is apr 8th (week 1), hide columns 17-52, therefore only show columns 1-16 (4 months at a time)

If anyone could help, I would really appreciate it.
 
Hi Jen,

Sorry for takign awhile to get back to you, i have inserted the code and changed the actual references to match my own.

I am getting a Run Type Error 13 - Type Mismatch on the line

MyWeek = Application.VLookup(MyDate, Sheets("Weeks").Range("A1:B52"), 2, False)

Thanks :)
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
both formatted as 'Date'

I wish I could upload the spreadsheet to show you, as it would be easier.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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