Hiding/Unhiding several lines at the click of a button

Is there a code i could implement into my sheets to 
unhide or hide the same line on several sheets

I want to enter the line number into a cell
Press a button called either 'HIDE' or 'UNHIDE' 
The code selects the line number entered in the cell on 
all sheets and either hides or unhides them. 

Thanks

Mally
0
12/15/2003 8:12:29 AM
excel.misc 78881 articles. 5 followers. Follow

6 Replies
823 Views

Similar Articles

[PageSpeed] 40


-- 

HTH

Bob Phillips
    ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mally" <mallybee69@aol.com> wrote in message
news:039701c3c2e3$2f0b4ba0$a501280a@phx.gbl...
> Is there a code i could implement into my sheets to
> unhide or hide the same line on several sheets
>
> I want to enter the line number into a cell
> Press a button called either 'HIDE' or 'UNHIDE'
> The code selects the line number entered in the cell on
> all sheets and either hides or unhides them.
>
> Thanks
>
> Mally


0
bob.phillips1 (6510)
12/15/2003 11:49:55 AM
Mally,

Here's a simple little routine

Sub HideRows(nRow As Long, Optional Hide As Boolean = True)
Dim sh As Worksheet

    For Each sh In Worksheets
        sh.Rows(nRow).EntireRow.Hidden = Hide
    Next sh

End Sub

example usage

hiderows 10, False

will unhide row 10 on all sheets

-- 

HTH

Bob Phillips
    ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mally" <mallybee69@aol.com> wrote in message
news:039701c3c2e3$2f0b4ba0$a501280a@phx.gbl...
> Is there a code i could implement into my sheets to
> unhide or hide the same line on several sheets
>
> I want to enter the line number into a cell
> Press a button called either 'HIDE' or 'UNHIDE'
> The code selects the line number entered in the cell on
> all sheets and either hides or unhides them.
>
> Thanks
>
> Mally


0
bob.phillips1 (6510)
12/15/2003 11:58:47 AM
Thanks for your help bob.  I'll give it a go and see how 
it goes.

Mally

>-----Original Message-----
>
>
>-- 
>
>HTH
>
>Bob Phillips
>    ... looking out across Poole Harbour to the Purbecks
>(remove nothere from the email address if mailing direct)
>
>"Mally" <mallybee69@aol.com> wrote in message
>news:039701c3c2e3$2f0b4ba0$a501280a@phx.gbl...
>> Is there a code i could implement into my sheets to
>> unhide or hide the same line on several sheets
>>
>> I want to enter the line number into a cell
>> Press a button called either 'HIDE' or 'UNHIDE'
>> The code selects the line number entered in the cell on
>> all sheets and either hides or unhides them.
>>
>> Thanks
>>
>> Mally
>
>
>.
>
0
anonymous (74719)
12/15/2003 12:22:42 PM
Thanks bob

How can i tell this code to select a cell that contains 
the row number that i have entered as a number.

Mally 


>-----Original Message-----
>Is there a code i could implement into my sheets to 
>unhide or hide the same line on several sheets
>
>I want to enter the line number into a cell
>Press a button called either 'HIDE' or 'UNHIDE' 
>The code selects the line number entered in the cell on 
>all sheets and either hides or unhides them. 
>
>Thanks
>
>Mally
>.
>
0
anonymous (74719)
12/15/2003 1:35:59 PM
Sub CallSubHideRows()
With Worksheets("Sheet4")
HideRows .Range("A1").Value
End Sub

-- 
Regards,
Tom Ogilvy


"Mally" <anonymous@discussions.microsoft.com> wrote in message
news:038201c3c310$5fdbf6d0$a001280a@phx.gbl...
> Thanks bob
>
> How can i tell this code to select a cell that contains
> the row number that i have entered as a number.
>
> Mally
>
>
> >-----Original Message-----
> >Is there a code i could implement into my sheets to
> >unhide or hide the same line on several sheets
> >
> >I want to enter the line number into a cell
> >Press a button called either 'HIDE' or 'UNHIDE'
> >The code selects the line number entered in the cell on
> >all sheets and either hides or unhides them.
> >
> >Thanks
> >
> >Mally
> >.
> >


0
twogilvy (1078)
12/15/2003 2:07:11 PM
Mally,

Add a commandbutton from the Control Toolbox (you migt need to unhide that
toolbar).
Double-click, this will build a skeleton Command button click event.

Add this code


Private Sub CommandButton1_Click()

    If IsNumeric(Range("A1").Value) Then
        HideRows Range("A1").Value, Not Rows(Range("A1").Value).Hidden
    End If

End Sub

Sub HideRows(nRow As Long, Optional Hide As Boolean = True)
Dim sh As Worksheet

    For Each sh In Worksheets
        sh.Rows(nRow).EntireRow.Hidden = Hide
    Next sh

End Sub

-- 

HTH

Bob Phillips
    ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mally" <anonymous@discussions.microsoft.com> wrote in message
news:038201c3c310$5fdbf6d0$a001280a@phx.gbl...
> Thanks bob
>
> How can i tell this code to select a cell that contains
> the row number that i have entered as a number.
>
> Mally
>
>
> >-----Original Message-----
> >Is there a code i could implement into my sheets to
> >unhide or hide the same line on several sheets
> >
> >I want to enter the line number into a cell
> >Press a button called either 'HIDE' or 'UNHIDE'
> >The code selects the line number entered in the cell on
> >all sheets and either hides or unhides them.
> >
> >Thanks
> >
> >Mally
> >.
> >


0
bob.phillips1 (6510)
12/15/2003 5:22:41 PM
Reply:

Similar Artilces:

Hiding "0" values in pivot table
In a worksheet I have a listing of stock records with ItemNumber, Date, StockLocation and NumberOnStock. When I make simple Pivot Table with ItemNumber and StockLocation as rows and select a Sum of "NumberOnStock" I would like to hide rows where the sum is "0". But this does not seem to be possible. Tried to follow the guidelines in the Microsoft article: http://office.microsoft.com/en-us/assistance/HP051998791033.aspx#Hide%20zero%20values%20in%20a%20PivotTable%20report But no luck :-( Mogens You could use conditional formatting on these cells - highlight the cells,...

Hiding formuals in cells question
Hi. I was wondering if there was a way to hide the formulas in cells without protecting the sheet. I am making something for other teachers at my school and I want to hide the formulas so they won't mess anything up on the spreadsheet. Any help would be greatly appreciated. Thanks! Hi not without protecting the sheet but why is this a problem for you? -- Regards Frank Kabel Frankfurt, Germany "JP" <JP@discussions.microsoft.com> schrieb im Newsbeitrag news:ABFE07BF-6087-4E24-814A-03AF8863A633@microsoft.com... > Hi. I was wondering if there was a way to hide the fo...

hide my name
When replying to an email or creating one from scratch how do i hide my name in the "from" field...thx fred <fdbjrgetridofthis@wowway.com> wrote: > When replying to an email or creating one from scratch how do i hide > my name in the "from" field...thx Are you saying you want the reply to be anonymous? -- Brian Tillman [MVP-Outlook] no, I don't mind if my email is revealed.. just my name. I have tried by removing it from the "User Name:" field in the email account but it continues to show up. I have also removed from the header informati...

Hiding and Un-Hiding Data fields
I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then...

How do I hide gaps in an Excel 2007 chart?
I have a bar chart that is showing gaps and i don't want them. The select data > hidden and empty cell button does not give an option to hide gaps. I think by default they are hidden but if you even click on this to see what it does the gaps are shown and no way to turn off. Hi, If you hide the actual rows then with the Plot visible cells only setting on the gaps will be removed. In xl2007 the setting is on the Select Data dialog, Hidden/empty cells button. Cheers Andy Waynesch wrote: > I have a bar chart that is showing gaps and i don't want them. The s...

Grid lines in Tasks printout?
How do I darken or change the color of them? ...

referencing data from several spreadsheets
I am trying to create a spreadsheet from multiple spreadsheets. Is there any way to program excel so that the next cell in a colum automatically references the next file in a folder ( identical shee and cell)? Example: cell A1 referneces excel spreadsheet entitle [CARTON105.xls]Sheet1'!$C$18 - I would like A2 to refenenc [CARTON106.xls]Sheet1'!$C$18 - and so forth - without having to go i and type each one or click on each individual spreadsheet -- Message posted from http://www.ExcelForum.com Hi Michelle, In F3 of Book3 I used the formula =INDIRECT("[Book"&ROW()-2&...

Hiding a worksheet #3
I want to hide a worksheet. So, I went to the format menu and the "worksheet" option is grayed out. Why? And, how do I "ungray" it. Hi is your worksheet protected ? -- Regards Frank Kabel Frankfurt, Germany llong wrote: > I want to hide a worksheet. So, I went to the format menu and the > "worksheet" option is grayed out. Why? And, how do I "ungray" it. I think Frank meant to ask about the Workbook--not the worksheet. (Check under Tools|protection|Protect workbook or Unprotect workbook) My question is: Is there another sheet in the w...

lines on bar charts
If I graph a simple straight trend line on a chart, how do I get it to run behind the bars on my chart - rather than showing across the bars? David, To do so, you will need to create an overlay chart. An overlay chart is simply one chart laid over another. First create the Excel generated line and bar chart. The, make a copy of the chart. Delete or make tranparent everything in the second chart with the exception of the columns. Finally, overlay the second chart over the first. What I'm describing above sounds like a lot of work. However, Jon Peltier has an example with VBA ...

Hide images when Hiding Rows
I have inserted images into cells, but when I hide the column the images are not hidden with that column, they just get squished between the two cells next to the hidden cell. Is there a setting or way to tie the image to that cell so that it hides/unhides appropriately with the row? -- kurt ------------------------------------------------------------------------ kurt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=35686 View this thread: http://www.excelforum.com/showthread.php?threadid=554712 Kurt You cannot insert an image into a cell. You can overlay ...

Need to display an error message when a duplicate object is clicked.
Hi all, I'm new to Access and I'm creating a simple IT Inventory database. My first form just has details on the device, and I want to be able to have the users select an IP address from a dropdown list. I have the list and the dropdown working flawlessly, but in my table I selected No Duplicates, so that no one IP address can be used twice. What I'd like to do, is that if the DB detects a duplicate, to pop up a dialog box stating that the IP address is already in use and to please select a valid IP address. By default, there is an error that pops up when you try to save the rec...

Hiding plot Area
I have a formatted output sheet that has a Pie Chart embedded. The data for the pie chart comes from a second sheet using 2 ranges B2:B6 & D2:D6 B2:B6 is always populated and contains labels. What I want to do is, when D2:D6 contains 0 in each cell (or Null), suppress the Pie chart but always show the Legend (which is driven by B2:B6) Many Thanks Adam Adam - All you see of the pie when all values are zero is a single line at the first slice. The legend still appears. To hide the line, double click on one of the wedges and on the Patterns tab, change the Border setting to None. ...

Catalog Merge templates do not line up when printed
It appears the "next record" logic in the Publisher mail merge logic is missing when attempting to print any document that has more than 1 copy per sheet? Publisher will only print data from one record per physical page and not move to next record for each postcard on the page. ie) 8.5" x 11" paper, 8.5" x 5.5" post card, 1 column per page, 2 cards per page But has anyone, in the MVP community, created a workaround? Being a long time user of MS tools, we always had to hack around the MS shortcomings. I'm not a Publisher expert and need to get a fix...

how to hide an ActiveX control?
hi there i have an ActiveX control, written in C++, which has the OLEMISC_INVISIBLEATRUNTIME flag set, yet when i display the web page it is attached to, i get the familiar "red cross" graphic in the middle of the screen - how can i hide the control so nothing is displayed at all? tia bhu can u set the size of ur control as 1x1 pixels "bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message news:1175703214.292931.252210@e65g2000hsc.googlegroups.com... > > hi there > > i have an ActiveX control, written in C++, which has the > OLEMISC_INVISIBLEATR...

Upload Button
I'm using WSS. In a document libaray, is there a way to hide or disable the Upload button on the tool bar? I can hide the options under the button but that does not disable the button. Thanks, Joel ...

Click on list Item and open a Detail form
Hi Everebody, I need help withe the following: I have a form that has a listbox that gets its data through a query, the list box only show two colums: Company and ProcessDate, also the query retrieves more fields but I set the width of the columns to zero. I also have a command button "CmdViewDetail" that on_click should open a new form that will contain the rest of the information for the record I selected on the list box. How should I do this? I'm not very experienced with vba, could somebody help me? hi Sara, Sara wrote: > I also have a command button "CmdV...

Hiding rows with VBA
Hi all, In my sheet called "insertsheet I have this VBA: (thanks to some users of Google groups) Private Sub Worksheet_Change(ByVal Target As Range) Const nMAX As Long = 10 Dim nRows As Long Application.ScreenUpdating = False With Me With .Range("B8") If Intersect(Target(1), .Cells) Is Nothing Then Exit Sub nRows = .Value End With .Range(.Cells(1, 5), .Cells(1, _ .Columns.Count)).EntireColumn.Hidden = True .Range(Cells(1, 5), .Cells(1, _ ...

hiding rows
I have data in cells A7:DK394 which all have 0 in them until totals are added in other worksheets which then pullthrough. At the end of the week I have to Hide all rows from A7 to A394 that still have 0 in them as no totals have been added in other sheets so the customer has not posted with us. is there any way excell can recognise the cells that have no data against them and hide them automatically by pressing a button. or if they all start off hidden unhide as data is entered. Hopefully this makes sense many thanks for any help with this as again its to save me lots of...

Outlook-hiding recipients addresses
How do you send a mailing to a distribution list without exposing their email addresses to the other recipients? Put the DL name in the BCC field and put your own address in the TO field. anonymous@discussions.microsoft.com wrote: > How do you send a mailing to a distribution list without > exposing their email addresses to the other recipients? ...

Hide contacts
I must hide some contacts from GAL excepted for 2 user that must to see them and select to send email. If only 2 users need a Contact, why not have them create it in their Contacts folder? -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- "MauroR" <MauroR@discussions.microsoft.com> wrote in message news:DAC0E2E9-7389-49F0-8736-3B9251DBB274@microsoft.com... >I must hide some contacts from GAL excepted for 2 user that must to see >them > and select to send email. Th...

How do I hide email addresses in outgoing mail
Hint: You post your question in the body of the post, not the Subject. Hint 2: Use the BCC field. -- Russ Valentine [MVP-Outlook] "Dennis" <Dennis@discussions.microsoft.com> wrote in message news:B2C2A70C-6C94-4688-8BAF-0A50AC9C142D@microsoft.com... > "Dennis" <Dennis@discussions.microsoft.com> wrote in message news:B2C2A70C-6C94-4688-8BAF-0A50AC9C142D@microsoft.com... > PLEASE write your question in the body of the post and NOT just the subject Have a look here: http://dts-l.net/goodpost.htm As posted here MANY MANY times - put them in the BCC...

Bitmap button question #2
I'm trying to create a bitmap button. Here's what I've done: 1. Added a CStatic control to my dialog. 2. Set it's ID to IDC_BMPBUTTON 3. In the classwizzard, member varialbes tab, created a member variable m_Button, of type CBitmapButton (I had to manually change this from CStatic). 4. In the OnInitDialog(), I've added: m_BitmapButton.LoadBitmaps(IDB_BITMAP1, IDB_BITMAP2, IDB_BITMAP3, IDB_BITMAP4); m_BitmapButton.SizeToContent(); m_BitmapButton.ShowWindow(SW_SHOW); When I run my dialog, the bitmap appears grey. And which ...

Can I Hide a Field?
I'm wanting to hide a field on a form (products form in this case) for some users but not for other users. Is this possible? For example, can I hide the product cost (wholesale) of an item for the salesperson, but not for the CEO? -- Brandon IT Director Office Equipment & Supplies at http://www.presentationsdirect.com Hi Brandon, You cannot have different formlayouts for different users/Teams at this time... Regards, Michael Randrup "Brandon S." <bsmith@presentationsdirect.nospam.com> wrote in message news:e4pDiMrYDHA.1620@TK2MSFTNGP12.phx.gbl... > I'm ...

Printing a single line item in SOP
I have a SO that is linked to a PO. 2 line items. Customer wants 2 different invoices, 1 each for line items. Can I print a single line item in the SOP module? ...

Hide Unhide Hide again
Hello, I'm using Excel 2003. It seems in the older versions, when I hid a column or row, it would put a little "+" tab above the labels. You could easily "click" or "unclick" ("hide" or unhide") the columns or rows. I need to be able to hid these rows or columns, but unhide them for use and then hid them again for ease of use and printing. Thank you. Hiding rows/columns and Grouping/Outline are quite different features. The little + sign occurs when you group (outline) it's not actually hiding rows Its under the DATA > GROUP AND O...