Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default delete row off 5 worksheets containing specific value

Being in either Column A or B is not a problem. Give this macro a try...

Sub ClearResponseRows()
Dim X As Long, WS As Worksheet, Response As String, S() As String
Response = UCase(InputBox("Enter value"))
If Response = vbNullString Then Exit Sub
S = Split("Sheet1,Sheet2,Sheet3,Sheet4,Sheet5", ",")
On Error GoTo NotFound
For X = 0 To UBound(S)
Worksheets(S(X)).Range("A:B").Find(What:=Response, LookIn:=xlValues, _
LookAt:=xlWhole, MatchCase:=False).EntireRow.Delete
Next
NotFound:
End Sub

Note: If you need to change the sheet names this macro applies to, you would
change the obvious text String argument to the Split function (4th statement
in the macro)... the text is comma delimited with no spaces around the
commas.

--
Rick (MVP - Excel)



"PVANS" wrote in message
...
Hi Mike,

There will only be one instance of this value

However, it won't necessariliy be on the same row on all sheets.

I can make it so it is definitely in column B not Column A or B if that
makes it easier

"Mike H" wrote:

Will it be on the same row in all sheets?
Could there be multiple instances of the value been sought?
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"PVANS" wrote:

Good Afternoon all,

Wonder if someone could give me a suggestion here - I have multiple
worksheets in a workbook. What I would like to do is have the user
type in a
value into an input box, and if that value is found either in column A
or
column B on Sheet1,Sheet2,Sheet3,Sheet4,Sheet5 (if its on one, it will
be on
all 5) for it to delete the entire row.

Can this be done? if so, please could you suggest a method

Thanks so much, I appreciate the assistance.

Regards,

Paul


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
vba to delete specific name from Name Manager HGood Excel Programming 8 September 15th 09 08:57 PM
Delete Specific Sheets Kevin H. Stecyk Excel Programming 2 January 20th 08 07:55 PM
Macro to delete specific rows in different worksheets [email protected] Excel Programming 5 March 19th 07 10:24 PM
print specific worksheets in specific order. jarvo Excel Programming 1 April 11th 06 11:05 AM


All times are GMT +1. The time now is 10:05 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"