ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Clear Contents - NonBold cells (https://www.excelbanter.com/excel-discussion-misc-queries/12556-clear-contents-nonbold-cells.html)

Steve

Clear Contents - NonBold cells
 
I have roughly 500-700 rows of information. All of my information is between
columns B and K. I would like to run a macro the clears the contents of the
cells based on NonBold font. For example; if b12 is is not bold, i want to
clear contents on b12:k12. Can anyone help?

Thanks,
Steve

Trevor Shuttleworth

Steve

some examples:

Sub test1()
If Range("B12").Font.Bold = False Then
Range("B12:K12").Clear
End If
End Sub

Sub test2()
Dim i As Long
For i = 2 To 14
If Range("B" & i).Font.Bold = False Then
Range("B" & i & ":K" & i).Clear
End If
Next 'i
End Sub

The first is specific to row 12; the second is for rows 2 to 14 - change to
suit.

Regards

Trevor


"Steve" wrote in message
...
I have roughly 500-700 rows of information. All of my information is
between
columns B and K. I would like to run a macro the clears the contents of
the
cells based on NonBold font. For example; if b12 is is not bold, i want to
clear contents on b12:k12. Can anyone help?

Thanks,
Steve




Steve

Worked great. Thanks Trevor.

"Trevor Shuttleworth" wrote:

Steve

some examples:

Sub test1()
If Range("B12").Font.Bold = False Then
Range("B12:K12").Clear
End If
End Sub

Sub test2()
Dim i As Long
For i = 2 To 14
If Range("B" & i).Font.Bold = False Then
Range("B" & i & ":K" & i).Clear
End If
Next 'i
End Sub

The first is specific to row 12; the second is for rows 2 to 14 - change to
suit.

Regards

Trevor


"Steve" wrote in message
...
I have roughly 500-700 rows of information. All of my information is
between
columns B and K. I would like to run a macro the clears the contents of
the
cells based on NonBold font. For example; if b12 is is not bold, i want to
clear contents on b12:k12. Can anyone help?

Thanks,
Steve





Trevor Shuttleworth

You are very welcome


"Steve" wrote in message
...
Worked great. Thanks Trevor.

"Trevor Shuttleworth" wrote:

Steve

some examples:

Sub test1()
If Range("B12").Font.Bold = False Then
Range("B12:K12").Clear
End If
End Sub

Sub test2()
Dim i As Long
For i = 2 To 14
If Range("B" & i).Font.Bold = False Then
Range("B" & i & ":K" & i).Clear
End If
Next 'i
End Sub

The first is specific to row 12; the second is for rows 2 to 14 - change
to
suit.

Regards

Trevor


"Steve" wrote in message
...
I have roughly 500-700 rows of information. All of my information is
between
columns B and K. I would like to run a macro the clears the contents of
the
cells based on NonBold font. For example; if b12 is is not bold, i want
to
clear contents on b12:k12. Can anyone help?

Thanks,
Steve








All times are GMT +1. The time now is 11:10 AM.

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