• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Bold the cell values based on criteria


Kindly advise a code to bold the cell value after selecting the cell and after running a macro with a certain condition as below:
Say the cells from A1 to A10 has the values as listed as below
if I select the cells from A1 to A10, then after running a macro, the result shall be, the cell that contains the values of 1.0. 2.0, 3.0, 4.0, 5.0 ONLY to be in BOLD and not the values after decimal >0 (not the 1.1, 1.3, 2.69, 3.59, 4.3) not to be in bold letters



Well-Known Member
please provide a workbook so that we know more about the formatting and contents of the cells, in the meantime this might work:
Sub blah()
For Each cll In Selection.Cells
  If cll.Value = Int(cll.Value) Then cll.Font.Bold = True
Next cll
End Sub
You can do it with conditional formatting too with a formula such as =A1=INT(A1)


Hi p45cal
Thanks for the code and the conditional formatting formula
It works perfect
Could you please advise the code or conditional formatting even if the cell is formatted as text
Thank you