How can this be modified to delete a row if bold text is in a specific column?
On Error Resume Next
Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
Thanks!
Scott
How can this be modified to delete a row if bold text is in a specific column?
On Error Resume Next
Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
Thanks!
Scott
Dim CCell As Range
On Error Resume Next
For Each CCell In Intersect(ActiveSheet.Columns(2), ActiveSheet.UsedRange)
If CCell.Characters.Font.Bold Then CCell.EntireRow.Delete
Next CCell
On Error Goto 0
This only works if the entire cell is bolded; if you need to find if any
individual character is bold you would have to step through each Character in
CCell.Characters - that would also take significantly more time to run. So
hopefully this simple version is what you need.
--
- K Dales
"Scott Wagner" wrote:
> How can this be modified to delete a row if bold text is in a specific column?
>
> On Error Resume Next
> Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
> On Error GoTo 0
>
> Thanks!
>
> Scott
That didn't work for me. It had problems with successive cells being blank
(as expected).
Sub BBB()
Dim lastrow as Long, i as Long
lastrow = Cells(Rows.Count, 2).End(xlUp).Row
For i = lastrow To 1 Step -1
If Cells(i, 2).Font.Bold Then
Rows(i).Delete
End If
Next
End Sub
avoids that problem.
--
Regards,
Tom Ogilvy
"K Dales" <KDales@discussions.microsoft.com> wrote in message
news:647B7B42-922C-462B-9DB1-9239203008A1@microsoft.com...
> Dim CCell As Range
>
> On Error Resume Next
> For Each CCell In Intersect(ActiveSheet.Columns(2), ActiveSheet.UsedRange)
> If CCell.Characters.Font.Bold Then CCell.EntireRow.Delete
> Next CCell
> On Error Goto 0
>
> This only works if the entire cell is bolded; if you need to find if any
> individual character is bold you would have to step through each Character
in
> CCell.Characters - that would also take significantly more time to run.
So
> hopefully this simple version is what you need.
> --
> - K Dales
>
>
> "Scott Wagner" wrote:
>
> > How can this be modified to delete a row if bold text is in a specific
column?
> >
> > On Error Resume Next
> > Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
> > On Error GoTo 0
> >
> > Thanks!
> >
> > Scott
> successive cells being blank
should have been
successive cells being BOLD
--
Regards,
Tom Ogilvy
"Tom Ogilvy" <twogilvy@msn.com> wrote in message
news:eTIQPjzOGHA.1124@TK2MSFTNGP10.phx.gbl...
> That didn't work for me. It had problems with successive cells being
blank
> (as expected).
>
> Sub BBB()
> Dim lastrow as Long, i as Long
> lastrow = Cells(Rows.Count, 2).End(xlUp).Row
> For i = lastrow To 1 Step -1
> If Cells(i, 2).Font.Bold Then
> Rows(i).Delete
> End If
> Next
> End Sub
>
> avoids that problem.
>
> --
> Regards,
> Tom Ogilvy
>
>
>
>
> "K Dales" <KDales@discussions.microsoft.com> wrote in message
> news:647B7B42-922C-462B-9DB1-9239203008A1@microsoft.com...
> > Dim CCell As Range
> >
> > On Error Resume Next
> > For Each CCell In Intersect(ActiveSheet.Columns(2),
ActiveSheet.UsedRange)
> > If CCell.Characters.Font.Bold Then CCell.EntireRow.Delete
> > Next CCell
> > On Error Goto 0
> >
> > This only works if the entire cell is bolded; if you need to find if any
> > individual character is bold you would have to step through each
Character
> in
> > CCell.Characters - that would also take significantly more time to run.
> So
> > hopefully this simple version is what you need.
> > --
> > - K Dales
> >
> >
> > "Scott Wagner" wrote:
> >
> > > How can this be modified to delete a row if bold text is in a specific
> column?
> > >
> > > On Error Resume Next
> > > Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
> > > On Error GoTo 0
> > >
> > > Thanks!
> > >
> > > Scott
>
>
Hi Scott
EasyFilter have this option
http://www.rondebruin.nl/easyfilter.htm
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Scott Wagner" <ScottWagner@discussions.microsoft.com> wrote in message news:4266AB42-943E-4D19-A00D-18654CEB492D@microsoft.com...
> How can this be modified to delete a row if bold text is in a specific column?
>
> On Error Resume Next
> Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
> On Error GoTo 0
>
> Thanks!
>
> Scott
Hi Scott
I fixed a bug in the delete option on the color tab of the add-in
I upload a new version
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:e%23fLT07OGHA.3164@TK2MSFTNGP11.phx.gbl...
> Hi Scott
>
> EasyFilter have this option
> http://www.rondebruin.nl/easyfilter.htm
>
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "Scott Wagner" <ScottWagner@discussions.microsoft.com> wrote in message news:4266AB42-943E-4D19-A00D-18654CEB492D@microsoft.com...
>> How can this be modified to delete a row if bold text is in a specific column?
>>
>> On Error Resume Next
>> Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
>> On Error GoTo 0
>>
>> Thanks!
>>
>> Scott
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks