LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default delete every row where value equals user input

Hi all.
The code pasted below works only it will not search and delete every row
equal to user value. I have had to press ctrl+b, then enter value such as
'cardiac' over and over. It will delete the row where there is a cell
containing the value cardiac however, it will not delete all rows where the
row contains cardiac. There are 4000+ rows with cardiac and other words that
need to be deleted off the spreadsheet. I know it must be loop but I don't
have any syntax reference or books. Please help me. Thanks in advance. Misty

Here is the code:

Sub Macro3()
' Keyboard Shortcut: Ctrl+b
Dim userResponse
With Worksheets(1).Range("A1:H100")
userResponse = Application.InputBox("Enter a value where the rows are to be
deleted")
Set c = .Find(userResponse, LookIn:=xlValues)
If Not c Is Nothing Then
c.EntireRow.Delete
End If
End With
End Sub

--
Message posted via http://www.officekb.com

 
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
How do I automatically delete a row, if one cell equals zero? Koz Excel Worksheet Functions 6 August 13th 08 08:42 PM
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
custom filter does not work when selecting 'equals' X AND 'equals' plindman Excel Discussion (Misc queries) 1 June 1st 05 11:29 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 05:32 PM.

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

About Us

"It's about Microsoft Excel"