Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    no delete line if contian 'AAAAA'... (2000 sr 1)

    I use this line to clear cells ELENCO.Range("A3:AI5000").ClearContents.
    Is possible to exclude from clearing, in this range, all lines that contain value "AAAAA" in column M...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: no delete line if contian 'AAAAA'... (2000 sr 1)

    You will have to loop through the rows:

    Dim lngRow As Long
    For lngRow = 3 To 5000
    If Not Range("M" & lngRow) = "AAAAA" Then
    Range("A" & lngRow & ":AI" & lngRow).ClearContents
    End If
    Next lngRow

    Alternatively, you could filter out the rows with "AAAAA" in column M, clear the filtered rows, then remove the filter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •