Show formating

Anax

New Member
Joined
Jun 29, 2005
Messages
14
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I can find a way to set any formatting for a particular cell but I cannot find a way to check the formatting. To make it simpler, I want to check if the text in cell is bold and if it is aligned on the right side.
Any suggestions?

Thanks in advance :)
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This may sound stupid, but have you tried entering anything in it?

You can goto Format-->Cells and check each property, where the current setting will be indicated.

Hope that helps,

Smitty
 
Upvote 0
I forgot to mention that this is part of VBA code.
The code to set range A1:A5 bold is:

Worksheets("Sheet1").Range("A1:A5").Font.Bold = True

What about if I want to check if A1:A5 is bold?
 
Upvote 0
<font face=tahoma><SPAN style="color:#00007F">Sub</SPAN> foo()
    <SPAN style="color:#00007F">Dim</SPAN> c <SPAN style="color:#00007F">As</SPAN> Range
        <SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> c <SPAN style="color:#00007F">In</SPAN> [A1:A5]
            <SPAN style="color:#00007F">If</SPAN> c.Font.Bold = <SPAN style="color:#00007F">True</SPAN> <SPAN style="color:#00007F">Then</SPAN> MsgBox "Bold"
        <SPAN style="color:#00007F">Next</SPAN> c
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

That's just a test...Not real practical.

Can you give some more detail as to what you're trying to accomplish?

Maybe post your code and an explanation of what you want it to do.

Smitty
 
Upvote 0

Forum statistics

Threads
1,203,144
Messages
6,053,738
Members
444,681
Latest member
Nadzri Hassan

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