Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
i want a looping macro that evaluates two columns in each row of the
spreadsheet and if both cell contain zeros hide the row. Basically if col b or col c is zero hide row otherwise don't hdie and move down one row to evaluate it, |
#2
![]() |
|||
|
|||
![]()
You can do this with the Autofilter............whether you want to delete
rows with one zero or two, or whatever........ Data Filter AutoFilter Custom "does not equal" 0.........then if you want to further massage that result, just copy and paste it over to another worksheet............ Vaya con Dios, Chuck, CABGx3 "Macro to hide rows in spreadwsheet" <Macro to hide rows in spreadwsheet @discussions.microsoft.com wrote in message ... i want a looping macro that evaluates two columns in each row of the spreadsheet and if both cell contain zeros hide the row. Basically if col b or col c is zero hide row otherwise don't hdie and move down one row to evaluate it, |
#3
![]() |
|||
|
|||
![]()
You give conflicting criteria - "both cells contain zeros" and "col b or
col c is zero" Which do you mean? In article , "Macro to hide rows in spreadwsheet" <Macro to hide rows in spreadwsheet @discussions.microsoft.com wrote: i want a looping macro that evaluates two columns in each row of the spreadsheet and if both cell contain zeros hide the row. Basically if col b or col c is zero hide row otherwise don't hdie and move down one row to evaluate it, |
#4
![]() |
|||
|
|||
![]()
I've done this before by putting a formula in a column in the spreadsheet to
evaluate whether or not the row should be hidden, then referencing that column in the code. So let's say you put this formula in column "Q": =IF(AND(B49=0,C49=0),"Y","N") Then in your macro: For rowNum = 49 To 778 If Range("Q" & rowNum) = "Y" Then Range("Q" & rowNum).Select Selection.EntireRow.Hidden = True End If Next rowNum Make sure you unhide all the rows before calculating the sheet and running this macro. "JE McGimpsey" wrote: You give conflicting criteria - "both cells contain zeros" and "col b or col c is zero" Which do you mean? In article , "Macro to hide rows in spreadwsheet" <Macro to hide rows in spreadwsheet @discussions.microsoft.com wrote: i want a looping macro that evaluates two columns in each row of the spreadsheet and if both cell contain zeros hide the row. Basically if col b or col c is zero hide row otherwise don't hdie and move down one row to evaluate it, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to hide rows | Excel Discussion (Misc queries) | |||
inset rows and copy formatting , excel macro | Excel Discussion (Misc queries) | |||
how to hide rows in a protected sheet | Excel Worksheet Functions | |||
Macro to hide rows with empty cells | Excel Worksheet Functions | |||
Macro for sorting different rows | Excel Worksheet Functions |