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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,214,641
Messages
6,120,695
Members
448,979
Latest member
DET4492

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