Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default hiding columns in excel based on formula result

Hi - I am trying to create a macro that will hide columns if date
(that is the column heading) is in the past, i.e. if column heading is
less than "Now()" then hide the column (the spreadsheet application is
a gantt chart of sorts for tracking resource utilization). Do you have
any idea how to do this?

I see lots of links for macros that hide rows or colunns based on
specific values but none for formula results. Please help!! thanks :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default hiding columns in excel based on formula result

try this. Change cells(1,5) to suit. You may want 1,1

Sub HideColumnsBeforeToday()
x = Rows(1).Find(Date, After:=Cells(1, 1), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext).Column
Range(Cells(1, 5), Cells(1, x)).EntireColumn.Hidden = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"hjbrooks2002" wrote in message
...
Hi - I am trying to create a macro that will hide columns if date
(that is the column heading) is in the past, i.e. if column heading is
less than "Now()" then hide the column (the spreadsheet application is
a gantt chart of sorts for tracking resource utilization). Do you have
any idea how to do this?

I see lots of links for macros that hide rows or colunns based on
specific values but none for formula results. Please help!! thanks :)


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
how can I have a formula result based on multiple criteria/columns nicky_p New Users to Excel 1 July 5th 06 01:45 PM
Automatically resize columns based on new formula result Kevin Ward Excel Discussion (Misc queries) 2 February 13th 06 06:08 PM
Hiding cells based on formula result Jim[_48_] Excel Programming 3 June 20th 04 12:26 AM
Hiding cells based on formula result Jim Ashley Excel Programming 0 June 19th 04 03:01 PM
Hiding cells based on formula result Jim Excel Programming 0 June 19th 04 02:52 PM


All times are GMT +1. The time now is 08:11 AM.

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"