Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 329
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
a formula to "go to" another cell if a condition is true? Rope Excel Discussion (Misc queries) 2 January 4th 08 06:16 AM
ISTEXT TRUE then copy formula from cell X E Cobb Excel Worksheet Functions 7 May 31st 07 08:19 PM
IF function...cell ref is a formula so True is retd when False sh Alison Excel Worksheet Functions 1 August 1st 06 12:58 AM
If a formula is too long then refer to the cell after a TRUE resul naiveprogrammer Excel Programming 1 September 8th 05 05:10 PM
formula to return the value of a cell based on a looked up true reference sarah Excel Worksheet Functions 2 February 2nd 05 08:15 PM


All times are GMT +1. The time now is 12:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"