View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default delete all matching rows

glad it helped


--
Don Guillett
SalesAid Software

"Rich" wrote in message
...
thanks don, thats works better than i expected

"Don Guillett" wrote:

You could also do for ALL sheets except by

for each sh in worksheets
if sh.name<"dontdeletethisone" then sh.rows(x).delete
next sh

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
try this. Correct word wrap and add the other months. NO selections
necessary or desired so no screen updating.

Sub DeleteRequestedRowsInAllSheets()
Dim sh As Worksheet
x = InputBox("Put in Row NUMBER to Delete")

Resp = MsgBox(Prompt:="This Action Will Reset All Pre Entered Data For
This Employee Continue?", Buttons:=vbYesNo)
If Resp = vbNo Then Exit Sub
Resp = MsgBox(Prompt:="Are You Sure You Want To Continue - This Action
Can
Not Be Undone", Buttons:=vbYesNo)
If Resp = vbNo Then Exit Sub

For Each sh In Worksheets(Array("Jan", "Feb", "Overview"))
sh.Rows(x).Delete
Next sh

End Sub


--
Don Guillett
SalesAid Software

"Rich" wrote in message
...
at the min i am using the following:-

Sub line9()
Resp = MsgBox(Prompt:="This Action Will Reset All Pre Entered Data For
This
Employee Continue?", Buttons:=vbYesNo)
If Resp = vbNo Then Exit Sub
Resp = MsgBox(Prompt:="Are You Sure You Want To Continue - This Action
Can
Not Be Undone", Buttons:=vbYesNo)
If Resp = vbNo Then Exit Sub
Application.ScreenUpdating = False
Sheets(Array("Jan", "Feb", "March", "April", "May", "June", "July",
"Aug",
"Sep", "Oct", _
"Nov", "Dec")).Select
Range("E9:AI9").Select
Selection.ClearContents
Sheets("Overview").Select
Range("B9:E9").Select
Selection.ClearContents
Range("B9").Select
Application.ScreenUpdating = True
End Sub

using this macro i would have to write it approx 130 times down the
main
page next to each persons name. i was hoping to be able to do a "one
hit"
button which when i click on it, it will ask me which row to delete
rather
than having 130 macros saying the same thing