Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Automatically add/hide rows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wx4usa@gmail.com - 28 Dec 2006 16:15 GMT
Is there a way to automatically add/show rows that have data? I have a
data entry sheet. Then I have a report. The report pulls data from the
entry sheet. If there is no data for a specific line/row item, is there
a way to automatically hide or not show the row(s) with no data? Thanks
KC Rippstein - 28 Dec 2006 18:44 GMT
Can you use AutoFilter and show NonBlanks?  This is how I set up my reports
that extract data from other data-entry worksheets.  The report has
auto-filter enabled, and I just show the filter drop down on column A (I
hide all the other filter buttons on all the other columns to make it
cleaner and prevent any confusion).  I just leave column A permanently set
to filter for NonBlanks.  When someone pulls up the report, they never see
the blank rows.

> Is there a way to automatically add/show rows that have data? I have a
> data entry sheet. Then I have a report. The report pulls data from the
> entry sheet. If there is no data for a specific line/row item, is there
> a way to automatically hide or not show the row(s) with no data? Thanks
wx4usa@gmail.com - 28 Dec 2006 19:11 GMT
Thanks KC,

Can you use more than one auto filter on a sheet?
As in the example below could you filter each or os there a way to make
it shrink/filter each category?

My example would be a budget as below could have as many as 40 line
items in each main category

Advertising
TV
ROP
MAIL
etc

Sales
Commissions
Clerical
etc.

Operations
Delivery
Warehouse
Salaries
Trucks
Fuel
etc

General and Admin
etc

> Can you use AutoFilter and show NonBlanks?  This is how I set up my reports
> that extract data from other data-entry worksheets.  The report has
[quoted text clipped - 8 lines]
> > entry sheet. If there is no data for a specific line/row item, is there
> > a way to automatically hide or not show the row(s) with no data? Thanks
KC Rippstein - 28 Dec 2006 19:39 GMT
Auto Filter goes across the top of your worksheet, so all headers are
included.
Generally, you use Auto Filter to narrow your list based on criteria in one
column.  If you add a second column to your Auto Filter, then you are taking
an already filtered list and making it even smaller based on your second set
of criteria.
It sounds like you have main categories in column A that should always show,
but then subcategories in column B that you don't want to show if there's no
data for that line in column C (and this assumes you are not putting a zero
but are just leaving it blank).  If this is what you're after, then turn on
your Auto Filter for columns A:C and filter column C for NonBlanks.
If you are using zeroes in column C, then you need to set up an Advanced
Filter.  The Excel help menu can walk you through that in no time and you'd
just set it up to only show rows where the value in C is greater than zero.

> Thanks KC,
>
[quoted text clipped - 42 lines]
>> > entry sheet. If there is no data for a specific line/row item, is there
>> > a way to automatically hide or not show the row(s) with no data? Thanks
wx4usa - 28 Dec 2006 20:05 GMT
KC,

Yes column A has Main Categories and sub categories and column B has
dollars.
Should I have Main in A, sub in B and dollars in C?

> Auto Filter goes across the top of your worksheet, so all headers are
> included.
[quoted text clipped - 57 lines]
> >> > entry sheet. If there is no data for a specific line/row item, is there
> >> > a way to automatically hide or not show the row(s) with no data? Thanks
KC Rippstein - 28 Dec 2006 22:00 GMT
Yes, I believe your main categories should be a formula adding up all the
values for the subcategories.  As a result, the main categories should
always be shown on professional financial statements.  I would recommend
moving subcats to B and dollars to C.

> KC,
>
[quoted text clipped - 77 lines]
>> >> > a way to automatically hide or not show the row(s) with no data?
>> >> > Thanks
wx4usa@gmail.com - 28 Dec 2006 19:43 GMT
KC,

I tried the filter and it works, but is there a way to have it
re-expand or unfilter a row when data is added?
I tried this and I could not get it to work.  I had to manually
re-autofilter the data.

My empty cell was linked to a data entry sheet on another page. When I
enter data there, Id like the filtered data to change to reflect the
new value

Can you help me?  I appreciate it

> Can you use AutoFilter and show NonBlanks?  This is how I set up my reports
> that extract data from other data-entry worksheets.  The report has
[quoted text clipped - 8 lines]
> > entry sheet. If there is no data for a specific line/row item, is there
> > a way to automatically hide or not show the row(s) with no data? Thanks
KC Rippstein - 28 Dec 2006 22:01 GMT
I assumed your data entry was on another worksheet.  If that's the case,
then the AutoFilter will automatically hide/unhide the appropriate rows as
data is missing/added.  You can just always leave it set to show "NonBlanks"
for column C.  Just don't bother touching the filter buttons on columns A or
B.

> KC,
>
[quoted text clipped - 24 lines]
>> > entry sheet. If there is no data for a specific line/row item, is there
>> > a way to automatically hide or not show the row(s) with no data? Thanks
KC Rippstein - 28 Dec 2006 22:37 GMT
You might need to revise your "link" to something like this:
=IF('OtherSheet'!C3>0,'OtherSheet'!C3,"")
This way you don't have zero values showing up...you convert those to blanks
using this formula, and then filtering NonBlanks is automatic.
Your main categories will be subtotals of the subcategory values underneath
it.  So for C2, =SUBTOTAL(9,C3:C8) using C8 as an example.  The last
"overall total" in column C (let's use C50) will be =SUBTOTAL(9,C2:C:49).
Hopefully that does the trick.

>I assumed your data entry was on another worksheet.  If that's the case,
>then the AutoFilter will automatically hide/unhide the appropriate rows as
[quoted text clipped - 32 lines]
>>> > a way to automatically hide or not show the row(s) with no data?
>>> > Thanks
wx4usa - 28 Dec 2006 22:56 GMT
KC,

I still cannot get the autofilter to automatically respond. Can I send
you a small file to look at?
I did reference the othere cell as =IF(Sheet3!A1<>0,Sheet3!A1,"")  and
all formatting is set to general on both sheets.  If I change cell a1
on the data sheet, it wont show unless I resort. What did I do wrong?

Thanks for your help

> You might need to revise your "link" to something like this:
> =IF('OtherSheet'!C3>0,'OtherSheet'!C3,"")
[quoted text clipped - 41 lines]
> >>> > a way to automatically hide or not show the row(s) with no data?
> >>> > Thanks
wx4usa@gmail.com - 28 Dec 2006 19:44 GMT
KC,
\
How did you hide all of the other filter buttons?

> Can you use AutoFilter and show NonBlanks?  This is how I set up my reports
> that extract data from other data-entry worksheets.  The report has
[quoted text clipped - 8 lines]
> > entry sheet. If there is no data for a specific line/row item, is there
> > a way to automatically hide or not show the row(s) with no data? Thanks
KC Rippstein - 28 Dec 2006 22:10 GMT
Copy the following code:

Sub HideSomeArrows()
'hide some autofilter arrows
Dim c As Range
Dim i As Integer
i = Cells(1, 1).End(xlToRight).Column
Application.ScreenUpdating = False
For Each c In Range(Cells(1, 1), Cells(1, i))
  Select Case c.Column
' The case numbers below tell Excel which columns to show
' the Auto Filter drop down button for.  Typing 1, 2, 5 will
' only show the Auto Filter buttons for Columns A, B, and E.
' Note that every column must have a header, as this process
' stops at the first blank cell in row 1.
    Case 3
      c.AutoFilter Field:=c.Column, Visibledropdown:=True
    Case Else
      c.AutoFilter Field:=c.Column, Visibledropdown:=False
  End Select
Next
Application.ScreenUpdating = True
End Sub

On your report worksheet (I'll assume it's called Sheet2), right click the
Sheet2 tab and select "View Code".  In the dominant window that pops up,
paste this code, press the button on your toolbar that looks like a "Play"
button, and ignore any errors that may or may not pop up.

Then use your windows taskbar at the bottom of your screen to go take a peek
at your worksheet to make sure it turned off the auto filter on columns A
and B.  If it was successful, use your windows taskbar to go back to your
VBA code editor and delete the code.  We're done with it, so you don't need
to keep it in there.

> KC,
> \
[quoted text clipped - 15 lines]
>> > entry sheet. If there is no data for a specific line/row item, is there
>> > a way to automatically hide or not show the row(s) with no data? Thanks
wx4usa - 28 Dec 2006 23:09 GMT
KC,

I still cannot get the autofilter to automatically respond. Can I send
you a small file to look at?
I did reference the othere cell as =IF(Sheet3!A1<>0,Sheet3!A1,"")  and
all formatting is set to general on both sheets.  If I change cell a1
on the data sheet, it wont show unless I resort. What did I do wrong?

Thanks for your help

> Copy the following code:
>
[quoted text clipped - 50 lines]
> >> > entry sheet. If there is no data for a specific line/row item, is there
> >> > a way to automatically hide or not show the row(s) with no data? Thanks
KC Rippstein - 29 Dec 2006 14:44 GMT
You're right, AutoFilter does not auto adjust as the data changes.  I am
sorry that I misspoke.

> KC,
>
[quoted text clipped - 69 lines]
>> >> > a way to automatically hide or not show the row(s) with no data?
>> >> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.