hide row 5 if a zero in cell D5

To All

The code below is copied from a reply (by Frank Kabel) to a previous post. It hides all rows with a zero in column D

Sub hide_rows(
Dim RowNdx As Lon
Dim LastRow As Lon

LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Ro
For RowNdx = LastRow To 1 Step -
    If Cells(RowNdx, "D").Value = 0 The
        Rows(RowNdx).Hidden = Tru
    End I
Next RowNd
End Su

Does anyone know how to re-write the code to hide row 5 if a zero is in cell D5

Thanks,
btk
0
bkeeney (3)
4/28/2004 5:17:48 PM
excel.misc 78881 articles. 5 followers. Follow

4 Replies
575 Views

Similar Articles

[PageSpeed] 59

Hi!

Try

Sub hide_row5()

If range("D5").Value = 0 Then Rows(5).Hidden = True

End Sub

Al

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

0
4/28/2004 5:31:57 PM
try
if range("d5")=0 then rows(5).hidden=true

-- 
Don Guillett
SalesAid Software
donaldb@281.com
"btk" <bkeeney@txk.net> wrote in message
news:7F234FD9-F14C-4F17-8B1F-6F075995AF3C@microsoft.com...
> To All,
>
> The code below is copied from a reply (by Frank Kabel) to a previous post.
It hides all rows with a zero in column D.
>
> Sub hide_rows()
> Dim RowNdx As Long
> Dim LastRow As Long
>
> LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
> For RowNdx = LastRow To 1 Step -1
>     If Cells(RowNdx, "D").Value = 0 Then
>         Rows(RowNdx).Hidden = True
>     End If
> Next RowNdx
> End Sub
>
> Does anyone know how to re-write the code to hide row 5 if a zero is in
cell D5?
>
> Thanks,
> btk


0
Don
4/28/2004 5:37:07 PM
Hi
try
sub hide_5()
if activesheet.range("d5")=0 then 
    rows(5).hidden=true
end if
end sub

-- 
Regards
Frank Kabel
Frankfurt, Germany


btk wrote:
> To All,
> 
> The code below is copied from a reply (by Frank Kabel) to a previous
> post. It hides all rows with a zero in column D. 
> 
> Sub hide_rows()
> Dim RowNdx As Long
> Dim LastRow As Long
> 
> LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
> For RowNdx = LastRow To 1 Step -1
>     If Cells(RowNdx, "D").Value = 0 Then
>         Rows(RowNdx).Hidden = True
>     End If
> Next RowNdx
> End Sub
> 
> Does anyone know how to re-write the code to hide row 5 if a zero is
> in cell D5? 
> 
> Thanks,
> btk
0
frank.kabel (11126)
4/28/2004 5:42:41 PM
A non-macro approach:

Data|filter|autofilter.

Use a custom filter, does not equal 0.



btk wrote:
> 
> To All,
> 
> The code below is copied from a reply (by Frank Kabel) to a previous post. It hides all rows with a zero in column D.
> 
> Sub hide_rows()
> Dim RowNdx As Long
> Dim LastRow As Long
> 
> LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
> For RowNdx = LastRow To 1 Step -1
>     If Cells(RowNdx, "D").Value = 0 Then
>         Rows(RowNdx).Hidden = True
>     End If
> Next RowNdx
> End Sub
> 
> Does anyone know how to re-write the code to hide row 5 if a zero is in cell D5?
> 
> Thanks,
> btk

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
4/29/2004 1:12:37 AM
Reply:

Similar Artilces:

Can you insert a picture into a specific cell?
Or do they only "float" on the page. Marc They float over the worksheet, but you can adjust the size so that it seems to fit a cell exactly. If you insert a picture, you can hold the alt-key down while you move/resize the picture. When it gets close to the edge of a cell, it'll snap-to that edge. Marc wrote: > > Or do they only "float" on the page. > > Marc -- Dave Peterson ...

How do you turn off/on the "1" or "2" or "+" or "-" view hide/unh.
What is or how do you control, turn on/off the small "1" "2" or "+" "-" hide/unhide view buttons right above the "A" cell? Sometimes shows when I hide columns. Hi 'Data - Goup/Outline' -- Regards Frank Kabel Frankfurt, Germany Seth wrote: > What is or how do you control, turn on/off the small "1" "2" or "+" > "-" hide/unhide view buttons right above the "A" cell? Sometimes > shows when I hide columns. You can toggle them to hide or display with <Ctrl> <8> Usi...

Summing Alternate Rows
We have spreadsheets with many rows and need to sum alternate rows. Is there a way to do this without entering a formula using the number of each row? -- KarenQ ------------------------------------------------------------------------ KarenQ's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=19608 View this thread: http://www.excelforum.com/showthread.php?threadid=395115 Try this: =SUMPRODUCT(--(MOD(ROW($A$1:$A$18),2)=1),$A$1:$A$18) That formula sums odd-row values in the range A1:A18. To sum even-row values the formula is: =SUMPRODUCT(--(MOD(ROW($A$1:$A$18...

How disable postmaster reply in exchange 5.5
I receive mail from virus in my Exchange 5.5 with this format name@mydomain with a virus attached My exchange server reply with postmaster with the original mail attached. I think that this is Mydoom virus. Please help me to disable NDR messages for any e-mail sent to an invalid address. Virus send e-mail with field FROM with addres that want attack and my exchange reply with postmaster with the original mail that contain mydoom virus. Excuse me for my bad english. It is not possible to disable generation of NDR with E55. Why not install antivirus for Exchange? ALEX wrote: > I rece...

Joining text with a formula in cell #4
just to complete the thread... I found the answer. You have to change the format of the cell to custom 0.00"*" this is the only way it will show only 2 decimal places Thanks for the hel -- Mustard Hea ----------------------------------------------------------------------- Mustard Head's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1630 View this thread: http://www.excelforum.com/showthread.php?threadid=27700 ...

Global Column Row Preview Font Size
I know I can change the column, row and preview font size for the current email folder's view, but how do I do it for all of the email folders? I have loads of email addresses each with lots of folders. I don't want to have to do each one at a time. Surely there must be a default font setting (even if it's only in the registry)? Thanks in advance, Tim. I too would love an answer to this. Ian "Timie Milie" <tim_milstead@yahoo.co.uk> wrote in message news:45782ee8$0$27107$db0fefd9@news.zen.co.uk... >I know I can change the column, row and preview font ...

Single click selects multiple cells
When clicking on a single cell multiple cells are selected. The one time solution for this is to zoom in or out. This is problematic as 60% seems to be the zoom that works most of the time but at this zoom level the cell contents do not display. The time lost and the frustration that builds is killing my productivity and office attitude. Please give all of us a permanet fix. -- Thanks Mike ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" butt...

Referencing cells across sheets
Hi, I've created a workbook with three sheets. The first three columns of sheet 2 and sheet 3 are referenced to the first three columns of sheet 1. What I'd like to do, is set the workbook up so that if I insert a row before, between or after referenced rows in sheet one, a row will also be inserted, and referenced, in the corresponding place on sheets 2 and 3. Does anyone know how to do this? Also, if no data is entered into a cell on sheet one, the value shown in the corresponding cells of sheets '2' and '3' is '0'. I need those cells to remain bla...

Copying Data in a cell in one sheet to a cell in another sheet
I've run into a problem trying to copy data from a cell in one sheet to another. I have a spreadsheet called "rating" which contains a number of formula that calculates a final number. I also have a spreadsheet called "Final" that copies over the information from "Rating". In "Final", I'm trying to copy a number from "Rating" into a particular cell. I put in =Rating! G89, but it won't work. When I press enter, a window pops up "Update value:Rating". I press enter again and in the cell where I want the number ...

How to unlock locked cells by MACRO?!
I have locked Sheet and I need to change particular cells. But when my macro wants to change it => ERROR :/ Is there any way to unprotect these particulary cells by macro and change them? - after that action, of course, I want to lock them again. Please help me, Pedro Just unprotect the sheet, do the work, and reprotect the sheet. Kind of like: activesheet.unprotect password:="yourpassword" 'your code to change stuff activesheet.protect password:="yourpassword" Petr N�me�ek wrote: > > I have locked Sheet and I need to change particular cells. But when m...

How to add a button to restore all altered cells original values?
I want to add a reset button to an excel spreadsheet that will restore the values of all changed cells to the original saved ones. Any help would be appreciated. Thanks Dawn Hi this would require quite some VBA code as you somehow have to store the original values for example on a separate hidden sheet -- Regards Frank Kabel Frankfurt, Germany "Dawnybros" <Dawnybros@discussions.microsoft.com> schrieb im Newsbeitrag news:3340601E-16EE-4296-8F50-B0BAC18EA387@microsoft.com... > I want to add a reset button to an excel spreadsheet that will restore the > values of all ...

Can i use conditional formating on a cell when it contains a formula?
I am trying a "conditional formatting" on a cell that contains formula, but it didn't work. "If cell value is equal to 0 then font - white" This doesn't work, stays always. If i use this condition on a cell without formula it works just fine. Thank -- si ----------------------------------------------------------------------- sit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=262 View this thread: http://www.excelforum.com/showthread.php?threadid=26784 Hi are you sure your formula returns an exact zero?. Could you post the formul...

Cell with large amount of data not showing all data
I'm running Excel 97. I have a cell with 358 words (1928 characters with spaces). Word wrap is on for the cell. Only part of the text is displayed even though the cell is big enough to show everything. If I make the cell wider (wider than a page) more of the text shows but not everything. I tried a new worksheet with the same text and had the same problem. Is this a known issue with excel? Is there a solution? Thanks, Brad Left to its own devices, excel will only show about 1000 characters in a cell. But you can add some alt-enters (to force a new line within the cell) and see more s...

Adding blank "separator" Rows in a Pivot Table
Does anyone know how to insert blank rows into a pivot table (say, between groupings, etc.)? There has to be a way, since some of the various table formats that come with Excel include blank rows. Double-click the field button that you want to format Click Layout Add a checkmark to Insert blank line after each item Click OK, twice Bucko wrote: > Does anyone know how to insert blank rows into a pivot table (say, > between groupings, etc.)? There has to be a way, since some of the > various table formats that come with Excel include blank rows. -- Debra Dalgleish Contextures http...

Protection/hide information
Good morning, If anyone has any useful web links for information regarding protection/hide information for 2000 & 2002 generally to broaden my knowledge that would be great. Thanks. Not really sure what you're looking for, but here's some info on worksheet/workbook protection: http://www.mcgimpsey.com/excel/removepwords.html In article <O1SJMW$VEHA.4064@TK2MSFTNGP11.phx.gbl>, "Kassie Alcorn" <marketing@qld.apollopatio.com.au> wrote: > If anyone has any useful web links for information regarding protection/hide > information for 2000 & ...

How to place a stable title row?
Hi there! For a scientific analyse I need to create an Excel table with more than 1.000 rows content. Now, how can I create a title row that doesn't scroll with the rest of the content, so one that is always visible at the top, while you scroll up and down the rest of the content. I hope that's possible like this! Otherwise, it will be pretty difficult to enter the data into the correct (of about 15) column. Thanks for your help in advance! One way: Assuming headers are in row1, Select A2. Click Window > Freeze pane This freezes the 1st row, so it always remains in view w...

formula to have 0 to 6.5 only in ref to other cell val of 0<=6.5
...

Moving exchange 5.5 to a new server exchange 2003
Good day all... how do I move exchange 5.5 to a brand new exchange server 2003. The new server will be in a new organization. Any info would be greatly appreciated. Thanks, Ray http://www.microsoft.com/usa/webcasts/ondemand/2340.asp http://support.microsoft.com/default.aspx?scid=fh;en- us;exch2003 Patrick Rouse Microsoft MVP - Terminal Server >-----Original Message----- >Good day all... how do I move exchange 5.5 to a brand new >exchange server 2003. The new server will be in a new >organization. Any info would be greatly appreciated. > >Thanks, >Ray > >. ...

Chart help Hide Months
I have a data sheet that has historical data, I only want to chart 13 months instead of all the data. Is there a way to do this? hide em -- Don Guillett SalesAid Software dguillett1@austin.rr.com "lmossolle@nc.rr.com" <lmossollencrrcom@discussions.microsoft.com> wrote in message news:EEF19AB1-9092-4B52-868E-574232FC8AC0@microsoft.com... >I have a data sheet that has historical data, I only want to chart 13 >months > instead of all the data. Is there a way to do this? Hi, If your data increase each month have a look at Jon Peltier's example of dynamic na...

changing a cell of 60 files
Hi all I've 60 files and another one which summarizes all of them.. I've to put a day in the cell a1 and then I'd like to cut and paste that day in the cell a1 of the other 60 files without having to change all of them manually. I'd like to save and then exit every single file.The files are named 0001 0002 0003..and so on. I know that this is possible with a macro..but I've got a problem.. It's possible not to have the prompt which asks for updates of the file everytime I open one of them?? Thanks for the help Rossella Hi Rossella http://www.rondebruin.nl/copy4.htm ...

Check if date is between two dates, then sum only those rows
I have tab1 with begin date in column A, end date in column B. Basically they are weeks, Mon-Sun (e.g. 01/04/2010 and 01/10/2010 in A/B resp.). Tab2 has data I'd like to count and sum. The transaction date is in column B. I want to sum tab2 column G (and a few other columns). Tab2 will be dynamic as I add records to it. Tab1 remains static with each week comprising one row. -- streetcar The best tool for it is a pivot table. Put in your layaut col A & B in row section, col G in Data section (double click to change it to sum - "sumarize by") Click yes...

how do i identically size cells to organize contents alphabeticall
how do i size the cells in excell to organize alphabetically The size of the cell has nothing to do with sorting them. -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/KB/555375 "entertainer" <entertainer@discussions.microsoft.com> wrote in message news:62754406-410E-4328-8A6A-679D001D7F70@microsoft.com... > how do i size the cells in excell to organize alphabetically As JoAnne points out, cell size has nothing to do with sorting. What is the current sate of your data and what would you like to see happen to i...

Data Validation circle cell position
Hi everyone. I want to create an alert that flashes a msgbox when a sheet is activated and contains data that is flagged as invalid by using the validation circles. In a large sheet, it is tricky to find all the cells that may contain invalid data which is why I want to be able to create a msgbox that lists the addresses or something like that. By looping through the shapes in the sheet, I can determine that these errors exist but I can't find out where they are as the data validation oval does not appear to have a .topleftcell location. I can find out where it is in ...

Replying to emails #5
I'm using Outlook 2007. Can someone tell me where is the setting I uncheck to not reply to messages in the same format that they were sent? I can't find it for the life of me. Thanks in advance. Wy "newtechie" <newtechie@nospam.com> wrote in message news:%23ehsbToQIHA.748@TK2MSFTNGP04.phx.gbl... > I'm using Outlook 2007. Can someone tell me where is the setting I > uncheck to not reply to messages in the same format that they were sent? > I can't find it for the life of me. > > Thanks in advance. > > Wy > AFAIK there IS no...

check List Cell
check List Cell I woul like a cell with the symbol of check for create a checking list in excel. how can i do and format a cell ? I would like to get a template with this options and add my list. I only need to select o deselect the items. Thanksxxx -- Esgrimidor hi if i understand correctly, format the cell to font marlett the type the lower case a. a check mark will appear. Regards FSt1 "Esgrimidor" wrote: > > check List Cell > > I woul like a cell with the symbol of check for create a checking list > in excel. > > how can i do and format a...