Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Sep 2001
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reading Contents of Cell (Excel 97)

    Hello People,

    I had this program written for me by a helpful lounger, but I was wondering instead of checking to see if the cell's background is black, how can I make it read to find in each cell the word "total" and delete the entire row if it does not contain the word.


    Dim I As Long
    For I = 65535 To 0 Step -1
    With ActiveSheet.Range("A1").Offset(I, 0)
    If .Interior.ColorIndex = 1 Then
    .EntireRow.Delete
    End If
    End With
    Next I

    Thanks!

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reading Contents of Cell (Excel 97)

    I don't know if I understand this correctly, but here is some code that might do what you want:

    <pre>Sub test()
    Dim I As Long
    For I = 65535 To 0 Step -1
    With ActiveSheet.Range("A1").Offset(I, 0)
    If .Value <> "Total" Then
    .EntireRow.Delete
    End If
    End With
    Next I
    End Sub
    </pre>


  3. #3
    Lounger
    Join Date
    Sep 2001
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reading Contents of Cell (Excel 97)

    Thanks

Posting Permissions

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