• Reading Contents of Cell (Excel 97)

    Author
    Topic
    #362153

    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!

    Viewing 0 reply threads
    Author
    Replies
    • #549291

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

      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
      
    Viewing 0 reply threads
    Reply To: Reading Contents of Cell (Excel 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: