eliW
Well-known Member
- Joined
- Mar 2, 2002
- Messages
- 1,940
Regarding my question in,
http://216.92.17.166/board2/viewtopic.php?t=81182
I would appreciate some help.
I started to build a macro that will be activated in every worksheet separately, checking id numbers in worksheet called "del" and delete the same records in the active worksheet.
It seems to work right when just "marking" the records by "*"
but the sentence to delete the entire row doesn't seem to work properly.
In the active worksheet I have numbers from 1-100 in column A
In "del" I have a list of numbers like: 2,4,12,23,50
Thank you in advance,
Eli
http://216.92.17.166/board2/viewtopic.php?t=81182
I would appreciate some help.
I started to build a macro that will be activated in every worksheet separately, checking id numbers in worksheet called "del" and delete the same records in the active worksheet.
It seems to work right when just "marking" the records by "*"
but the sentence to delete the entire row doesn't seem to work properly.
Code:
Sub DelRecList()
Dim cel1, cel2 As Range
For Each cel1 In Range("a1:a100")
For Each cel2 In Worksheets("del").Range("a1:a5")
If cel1.Value = cel2.Value Then
'cel1.EntireRow.Delete <----------------------problem
cel1.Value = "*"
End If
Next cel2
Next cel1
End Sub
In the active worksheet I have numbers from 1-100 in column A
In "del" I have a list of numbers like: 2,4,12,23,50
Thank you in advance,
Eli