+ Reply to Thread
Results 1 to 3 of 3

Delete Non-bolded lines only

Hybrid View

  1. #1
    Annette
    Guest

    Delete Non-bolded lines only

    How would I write to delete any lines that in column A which are not bolded
    and not include blank cells?

    Thanks!

    Annette



  2. #2
    Tom Ogilvy
    Guest

    Re: Delete Non-bolded lines only

    Dim lastrow as Long
    Dim i as Long
    Dim cell as Range
    lastrow = cells(rows.count,1).End(xlup).row
    for i = lastrow to 1 step -1
    set cell = cells(i,1)
    if cell.Font.Bold then
    if not isempty(cell) then
    cell.EntireRow.Delete
    end if
    end if
    Next

    --
    Regards,
    Tom Ogilvy

    "Annette" <Ann@alltech.com> wrote in message
    news:uMKckulgFHA.3788@tk2msftngp13.phx.gbl...
    > How would I write to delete any lines that in column A which are not

    bolded
    > and not include blank cells?
    >
    > Thanks!
    >
    > Annette
    >
    >




  3. #3
    Bob Phillips
    Guest

    Re: Delete Non-bolded lines only


    iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
    For i = iLastRow to 1 step -1
    If Cells(i,"A").Value = "" Or _
    Cells(i,"A").Font.Bold = False Then
    Rows(i).Delete
    End If
    Next i

    --
    HTH

    Bob Phillips

    "Annette" <Ann@alltech.com> wrote in message
    news:uMKckulgFHA.3788@tk2msftngp13.phx.gbl...
    > How would I write to delete any lines that in column A which are not

    bolded
    > and not include blank cells?
    >
    > Thanks!
    >
    > Annette
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1