Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF cell=TRUE how can I delete that row in formula
I am using this code to test for near duplicate entries but can not auto
delete row that tests OK or TRUE =IF(MID(A2,1,5)=MID(A3,1,5),IF(MID(B2,1,8)=MID(B3, 1,8),"OK","NOT OK")) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF cell=TRUE how can I delete that row in formula
If you want to delete a row based upon a condition, that would need VBA. Is
that acceptable? -- HTH Bob Phillips (there's no email, no snail mail, but somewhere should be gmail in my addy) "Stanley Braverman" wrote in message ... I am using this code to test for near duplicate entries but can not auto delete row that tests OK or TRUE =IF(MID(A2,1,5)=MID(A3,1,5),IF(MID(B2,1,8)=MID(B3, 1,8),"OK","NOT OK")) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF cell=TRUE how can I delete that row in formula
Hi Stanley,
Formulae can't delete rows - you'd need a macro to automate that. For example, if you put the following code into the relevant 'Worksheet' module: Private Sub Worksheet_Calculate() Update End Sub Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells(1, 1) = Range("A1") Then Update End If End Sub and the following code into a standard module: Sub Update() If Range("A1").Value = "OK" Then Range("A10").EntireRow.Hidden = True Else Range("A10").EntireRow.Hidden = False End If End Sub Then, anytime you type 'OK' (case sensitive) into Cell A1, or its value is changed to 'OK' by a formula, Row 10 will be hidden. Change the value in A1 to something else and Row 10 will be unhidden. Modify the cell addresses/ranges to suit your needs. Cheers -- macropod [MVP - Microsoft Word] "Stanley Braverman" wrote in message ... | I am using this code to test for near duplicate entries but can not auto | delete row that tests OK or TRUE | | =IF(MID(A2,1,5)=MID(A3,1,5),IF(MID(B2,1,8)=MID(B3, 1,8),"OK","NOT OK")) | | |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF cell=TRUE how can I delete that row in formula
Maybe you can apply data|Filter|autofilter to show only the rows you want to
delete. Then you can delete those visible rows. Stanley Braverman wrote: I am using this code to test for near duplicate entries but can not auto delete row that tests OK or TRUE =IF(MID(A2,1,5)=MID(A3,1,5),IF(MID(B2,1,8)=MID(B3, 1,8),"OK","NOT OK")) -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF cell=TRUE how can I delete that row in formula
data|Filter|autofilter works perfectly. Thanks for that easy
solution!!!!!! "Dave Peterson" wrote in message ... Maybe you can apply data|Filter|autofilter to show only the rows you want to delete. Then you can delete those visible rows. Stanley Braverman wrote: I am using this code to test for near duplicate entries but can not auto delete row that tests OK or TRUE =IF(MID(A2,1,5)=MID(A3,1,5),IF(MID(B2,1,8)=MID(B3, 1,8),"OK","NOT OK")) -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
a formula to "go to" another cell if a condition is true? | Excel Discussion (Misc queries) | |||
ISTEXT TRUE then copy formula from cell X | Excel Worksheet Functions | |||
IF function...cell ref is a formula so True is retd when False sh | Excel Worksheet Functions | |||
If a formula is too long then refer to the cell after a TRUE resul | Excel Programming | |||
formula to return the value of a cell based on a looked up true reference | Excel Worksheet Functions |