VBA Find unbold data

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
884
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,

I have data in which green, Blue shaded data should be in Bold and grey shaded should be in unbold

but in below data while doing manual bold and unbold some greeen shadded coloer bold is miss

so i want to find out where ever i have miss bold

Book1
BCDEFG
241%16.143%15.363%8.7
3
439%15.239%4.249%20.2
545%20.445%6.564%12.9
6
793%0.990%4.495%-4.1
836%13.937%12.549%20.5
912%12.112%22.227%6.4
1044%14.244%15.161%12.9
11162/881168/819106/288
Sheet1
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Is this not a continuation of this issue?
Isn't your choice of bold or not governed by the conditional formatting you show in that thread?
 
Upvote 0
Below code is basic example what you should do.
It will check each cell in range C1:C10
IF cell color is green AND if it is not BOLD and show that cell address.
You can change range and add Loop to check for each column.

VBA Code:
Sub is_BOLD()
Dim wb As Workbook
Dim ws As Worksheet
Dim rg As Range

Set ws = ActiveSheet
Set rg = ws.Range("C1:C10")

For Each cell In rg
If cell.Font.Bold = False And _
cell.Interior.Color = RGB(150, 193, 29) Then

MsgBox (cell.Address)

End If

Next
End Sub
 
Upvote 0
Is this not a continuation of this issue?
Isn't your choice of bold or not governed by the conditional formatting you show in that thread?
Hi Micro,

This is a different scenario i have copied the data from PPT file and would like to find unbold data under shaded :)

Regards
Sanjeev
 
Upvote 0
Below code is basic example what you should do.
It will check each cell in range C1:C10
IF
cell color is green AND if it is not BOLD and show that cell address.
You can change range and add Loop to check for each column.

VBA Code:
Sub is_BOLD()
Dim wb As Workbook
Dim ws As Worksheet
Dim rg As Range

Set ws = ActiveSheet
Set rg = ws.Range("C1:C10")

For Each cell In rg
If cell.Font.Bold = False And _
cell.Interior.Color = RGB(150, 193, 29) Then

MsgBox (cell.Address)

End If

Next
End Sub

Hi,

Thank you so much this works for us but for blue color it didnt came (Cell E19) in Msg box

just wanted to check can we have Mgs box cell address in cell border where ever we miss to bold

Regards
Sanjeev
 
Upvote 0
This will check for both colors.

VBA Code:
Sub is_BOLD()
Dim wb As Workbook
Dim ws As Worksheet
Dim rg As Range

Set ws = ActiveSheet
Set rg = ws.Range("E1:E10")

For Each cell In rg
If cell.Font.Bold = False And _
cell.Interior.Color = RGB(150, 193, 29) Then

MsgBox ("Green cell is unbold:" & cell.Address)

ElseIf cell.Font.Bold = False And _
cell.Interior.Color = RGB(14, 173, 195) Then

MsgBox ("Blue cell is unbold:" & cell.Address)

End If

Next
End Sub

If you want to check cell no matter of color, you will need to delete this parts:
"And _
cell.Interior.Color = RGB(150, 193, 29) "

"
And _
cell.Interior.Color = RGB(14, 173, 195) "
 
Upvote 0
This will check for both colors.

VBA Code:
Sub is_BOLD()
Dim wb As Workbook
Dim ws As Worksheet
Dim rg As Range

Set ws = ActiveSheet
Set rg = ws.Range("E1:E10")

For Each cell In rg
If cell.Font.Bold = False And _
cell.Interior.Color = RGB(150, 193, 29) Then

MsgBox ("Green cell is unbold:" & cell.Address)

ElseIf cell.Font.Bold = False And _
cell.Interior.Color = RGB(14, 173, 195) Then

MsgBox ("Blue cell is unbold:" & cell.Address)

End If

Next
End Sub

If you want to check cell no matter of color, you will need to delete this parts:
"And _
cell.Interior.Color = RGB(150, 193, 29) "

"
And _
cell.Interior.Color = RGB(14, 173, 195) "


Thanks you so much :):)
 
Upvote 0
Thanks you so much :):)


Just wanted to check can we get border line shown in example

Book1
BCDEFG
241%16.143%15.363%8.7
3
439%15.239%4.249%20.2
545%20.445%6.564%12.9
6
793%0.990%4.495%-4.1
836%13.937%12.549%20.5
912%12.112%22.227%6.4
1044%14.244%15.161%12.9
Sheet1
 
Upvote 0
Thanks you so much :):)


Just wanted to check can we get border line shoe
1665784556253.png
 
Upvote 0
You are welcome.
I don't really understand your question about borders.
If you want to check cells which is not bold by border color. For that you can just replace cell.Interior.Color with cell.Border.Color
But also, you will need replace RGB code with color code of borders.
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,827
Members
449,470
Latest member
Subhash Chand

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top