Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dewayne
 
Posts: n/a
Default View and Cell Sum Range

I am looking for a way to change the view i.e. change hidden columns
representing months and change the cell range sum within a totals column
depending on which view (month) is selected. I am able to change the view by
month but the cell range in the totals column does not change with custom
view feature. Is there anyway to do this at one time without having to
create a new file for each month?
Thank you.
--
Dewayne
  #2   Report Post  
Don Guillett
 
Posts: n/a
Default

Here is one I just did for a client that should give you the idea. This one
hides all days that are not the day of the date in the target cell.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$B$4" Then Exit Sub
Application.ScreenUpdating = False
Set myrng = Range("c5:bd5")
[myrng].EntireColumn.Hidden = False
For Each c In [myrng]
If c < Format([b4], "Ddd") then c.EntireColumn.Hidden = True
Next c
Application.ScreenUpdating = True
End Sub

Sub UnhideAllColumns()
Columns.EntireColumn.Hidden = False
End Sub

--
Don Guillett
SalesAid Software

"Dewayne" wrote in message
...
I am looking for a way to change the view i.e. change hidden columns
representing months and change the cell range sum within a totals column
depending on which view (month) is selected. I am able to change the view

by
month but the cell range in the totals column does not change with custom
view feature. Is there anyway to do this at one time without having to
create a new file for each month?
Thank you.
--
Dewayne



  #3   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

If you have the month names in the headings, you could use SUMIF,
instead of SUM. Allow the user to select a month from a dropdown list.
That could run a macro to change the view, and the month could be used
in the SUMIF formula.

There are sample formulas he

http://www.contextures.com/xlFunctions01.html#SumIf

Dewayne wrote:
I am looking for a way to change the view i.e. change hidden columns
representing months and change the cell range sum within a totals column
depending on which view (month) is selected. I am able to change the view by
month but the cell range in the totals column does not change with custom
view feature. Is there anyway to do this at one time without having to
create a new file for each month?
Thank you.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #4   Report Post  
Dewayne
 
Posts: n/a
Default

Thank you for the hepl Don

"Don Guillett" wrote:

Here is one I just did for a client that should give you the idea. This one
hides all days that are not the day of the date in the target cell.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$B$4" Then Exit Sub
Application.ScreenUpdating = False
Set myrng = Range("c5:bd5")
[myrng].EntireColumn.Hidden = False
For Each c In [myrng]
If c < Format([b4], "Ddd") then c.EntireColumn.Hidden = True
Next c
Application.ScreenUpdating = True
End Sub

Sub UnhideAllColumns()
Columns.EntireColumn.Hidden = False
End Sub

--
Don Guillett
SalesAid Software

"Dewayne" wrote in message
...
I am looking for a way to change the view i.e. change hidden columns
representing months and change the cell range sum within a totals column
depending on which view (month) is selected. I am able to change the view

by
month but the cell range in the totals column does not change with custom
view feature. Is there anyway to do this at one time without having to
create a new file for each month?
Thank you.
--
Dewayne




  #5   Report Post  
Dewayne
 
Posts: n/a
Default

Thanks for the help Debra

"Debra Dalgleish" wrote:

If you have the month names in the headings, you could use SUMIF,
instead of SUM. Allow the user to select a month from a dropdown list.
That could run a macro to change the view, and the month could be used
in the SUMIF formula.

There are sample formulas he

http://www.contextures.com/xlFunctions01.html#SumIf

Dewayne wrote:
I am looking for a way to change the view i.e. change hidden columns
representing months and change the cell range sum within a totals column
depending on which view (month) is selected. I am able to change the view by
month but the cell range in the totals column does not change with custom
view feature. Is there anyway to do this at one time without having to
create a new file for each month?
Thank you.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


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
cannot view all of text in large cell, even though I have it to w. sydme Excel Discussion (Misc queries) 1 December 27th 04 03:26 PM
highlighting positive or negative change Dave Excel Discussion (Misc queries) 2 December 27th 04 01:28 PM
add cell ROLG Excel Discussion (Misc queries) 2 November 26th 04 06:34 PM
Same Cell Header For Every Page localhost Excel Discussion (Misc queries) 1 November 26th 04 02:40 PM
Highlight Active Cell Db1712 Excel Discussion (Misc queries) 1 November 26th 04 01:14 PM


All times are GMT +1. The time now is 12:42 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"