Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deleteing lines with other than bold text (2003)

    Hi all,
    I have a spreadsheet that occupies space A1:F1019. There are lines with either bold or unbolded text in them. Is it possible to using a macro (or any other suggestion) to delete whole lines that contain unbolded text? This means I will be left with a spreadsheet that only has bolded text and values remaining.
    Is this possible?
    Thanks.

    Bill

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

    Re: Deleteing lines with other than bold text (2003)

    Will all cells in one row (in columns A:F) always be either bold, or not bold, i.e. no mixture of bold/not bold within one row? Will there be blank cells in the range A1:F1019?

  3. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleteing lines with other than bold text (200

    Hi Hans,
    Yes, the lines will either be all bold or all unbold. There will be blank cells in the range.
    Thanks heaps.

    Bill

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

    Re: Deleteing lines with other than bold text (200

    Assuming that An:Fn will have been formatted as bold whether the cells are filled or not, it is enough to look at the cell in column A to determine which rows should be deleted:

    Sub RemoveNonBold()
    Dim lngRow As Long
    Application.ScreenUpdating = False
    For lngRow = 1019 To 1 Step -1
    If Range("A" & lngRow).Font.Bold = False Then
    Range("A" & lngRow).EntireRow.Delete
    End If
    Next lngRow
    Application.ScreenUpdating = True
    End Sub

  5. #5
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleteing lines with other than bold text (200

    Hans,
    I got to tell you, I'm impressed! Thanks so much.
    All the best.

    Bill

Posting Permissions

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