Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Columns

Hi all

The setup is I have weekdays listed starting with June 1st in C6 goin
horizontal across the whole sheet to IV6. I wanted to do
workbook_open event where it takes whatever today's date is and hide
the columns From C6 through yesterday. Essentially so today's colum
will be right next to the B column. So if today's date is in H6, C6-G
would become hidden when one were to open the workbook.

Thanks so much for the insight.
B

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hide Columns

Range("C6:IV6").EntireColumn.Hidden = False
res = application.Match(clng(Date-1),Range("C6:IV6"),0)
if not res is nothing then
Range("C6",Range("C6:IV6")(res)).EntireColumn.Hidd en = True
End if

--
Regards,
Tom Ogilvy

"rickey24 " wrote in message
...
Hi all

The setup is I have weekdays listed starting with June 1st in C6 going
horizontal across the whole sheet to IV6. I wanted to do a
workbook_open event where it takes whatever today's date is and hides
the columns From C6 through yesterday. Essentially so today's column
will be right next to the B column. So if today's date is in H6, C6-G6
would become hidden when one were to open the workbook.

Thanks so much for the insight.
Bo


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Columns

Tom

Thanks for the help, but I am getting a 424 error and it i
highlighting the line:

if not res is nothing then

Do you know what this could be?

Thanks

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hide Columns

my bad

should be

if not iserror(res) then

--
Regards,
Tom Ogilvy


"rickey24 " wrote in message
...
Tom

Thanks for the help, but I am getting a 424 error and it is
highlighting the line:

if not res is nothing then

Do you know what this could be?

Thanks.


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Columns

Tom

Thanks again for the help, works now. Although I have one las
question. Since I only have weekday dates listed in Row C, If today i
Monday then the formula doesn't work. Is there a way, to say if Date
Monday then ...(Clng(Date - 3) else ...(Clng(Date -1). I am not to
worried about opening it up over the weekend. Thanks again

B

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Columns

Dim idex as Long, res as Variant
Range("C6:IV6").EntireColumn.Hidden = False
idex = choose(Weekday(Date,vbSunday),2,3,1,1,1,1,1)
res = application.Match(clng(Date-idex),Range("C6:IV6"),0)
if not res is nothing then
Range("C6",Range("C6:IV6")(res)).EntireColumn.Hidd en = True
End if

--
Regards,
Tom Ogilv

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to Hide columns in spreadsheet but NOT hide data in chart. KrispyData Charts and Charting in Excel 1 March 20th 09 04:45 PM
Hide Columns If... Karin Excel Discussion (Misc queries) 3 September 4th 08 11:36 PM
Hide/Unhide columns using button on top over relevant columns [email protected] Excel Discussion (Misc queries) 1 March 7th 07 09:24 PM
Hide some columns? Ken New Users to Excel 1 October 26th 06 03:25 AM
Hide columns alm09 Excel Discussion (Misc queries) 1 June 27th 05 04:14 PM


All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"