A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"delete" function



 
 
Thread Tools Display Modes
  #1  
Old June 23rd, 2004, 04:15 PM
deb
external usenet poster
 
Posts: n/a
Default "delete" function

I want to be able to delete an entire row, if a certain
cell within the row comes up with a certain value.

Example:
IF(B12="NA",DELETE12:12)

Is there a "delete" function or something that can do this?
Thanks!
  #2  
Old June 23rd, 2004, 05:47 PM
Juan Sanchez
external usenet poster
 
Posts: n/a
Default "delete" function


I can't think of a way to do it wit out code, but with
code is fairly easy:

right click on the sheet where you want this condition to
happen, click on view code, and paste this lines the

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If UCase(Range("B12").Value) = "NA" Then Range
("b12").EntireRow.Delete
End Sub

This will delete the entire row 12 every time theres an NA
on B12...

Cheers,
Juan


-----Original Message-----
I want to be able to delete an entire row, if a certain
cell within the row comes up with a certain value.

Example:
IF(B12="NA",DELETE12:12)

Is there a "delete" function or something that can do

this?
Thanks!
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:15 PM.


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