![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Los Angeles, CA
Posts: 752
|
I have no idea how to write a macro that would do this but this is what I need.
If in column b the word "count" appears in a cell with other text and if next to it in column c equals "1". I want that row and the row above it to be deleted. Cause I don't know how to write this, I am currently doing this manually. Please help, I'm growing very impatient. Thanks |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: New York
Posts: 71
|
Sub Deleter()
del = InputBox("Text to delete + 4 rows?", , ActiveCell.Value) On Error Resume Next 1: Set rw = Columns(1).Find(del, lookat:=xlWhole) If Not rw Is Nothing Then rw.Resize(5).Delete GoTo 1 End If End Sub |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Los Angeles, CA
Posts: 752
|
Thanks for the help but I made a minor mistake and I don't know if it will effect the macro.
The word "count" is in column a and the number 1 is in column b. Please let me know, thanks. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|