ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delet row if bold (https://www.excelbanter.com/excel-programming/323071-delet-row-if-bold.html)

jeffbert

Delet row if bold
 
Does anyone have a macro to evaluate column A and delete if formatting is
<bold?


Bernie Deitrick

Delet row if bold
 
Jeff,

Sub DeleteBold()

Dim myRow As Long

For myRow = Range("A65536").End(xlUp).Row To 1 Step -1
If Cells(myRow, 1).Font.Bold Then Cells(myRow, 1).EntireRow.Delete
Next myRow

End Sub

HTH,
Bernie
MS Excel MVP

"jeffbert" wrote in message
...
Does anyone have a macro to evaluate column A and delete if formatting is
<bold?




David Myle

Delet row if bold
 
Sub DeleteBold()
set rng =Range("a1: a" &[a65536].End(xlup).Row)
For each c in rng
If c.font.Bold = True Then
c.Clear
End if
Next
End Sub

DM


"jeffbert" wrote in message
...
Does anyone have a macro to evaluate column A and delete if formatting is
<bold?




jeffbert

Delet row if bold
 
Thanks to both of you for the help. Is there a way to select a variable
column? I have just run across a situation where sometimes I need column A,
sometimes B, etc.

"David Myle" wrote:

Sub DeleteBold()
set rng =Range("a1: a" &[a65536].End(xlup).Row)
For each c in rng
If c.font.Bold = True Then
c.Clear
End if
Next
End Sub

DM


"jeffbert" wrote in message
...
Does anyone have a macro to evaluate column A and delete if formatting is
<bold?





Tom Ogilvy

Delet row if bold
 
Sub DeleteBold()

Dim myRow As Long
Dim col as long
col = ActiveCell.Column

For myRow = Cells((rows.count,col) _
.End(xlUp).Row To 1 Step -1
If Cells(myRow, col).Font.Bold Then _
Cells(myRow, 1).EntireRow.Delete
Next myRow

End Sub

--
Regards,
Tom Ogilvy


"jeffbert" wrote in message
...
Thanks to both of you for the help. Is there a way to select a variable
column? I have just run across a situation where sometimes I need column

A,
sometimes B, etc.

"David Myle" wrote:

Sub DeleteBold()
set rng =Range("a1: a" &[a65536].End(xlup).Row)
For each c in rng
If c.font.Bold = True Then
c.Clear
End if
Next
End Sub

DM


"jeffbert" wrote in message
...
Does anyone have a macro to evaluate column A and delete if formatting

is
<bold?








All times are GMT +1. The time now is 05:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com