excel - Change a cell's format to boldface if the value is over 500 -


I am using Excel 2010 and am trying to add a bunch of rows from which columns in columns A and B. The amount of C should be inserted. If the amount is greater than 500, then I want to bold the number in column C. My work given below works mathematically, but will not make bold formatting. Can someone tell me what I am doing wrong? In the form of an integer 'row' row = 2 'sets a variable in the first row of 2b / c, make a headline (row, 3). Formula = "= a" & amp; Line & amp; amp; "+ B" & amp; Row 'stands for column 3. If ActiveCell.Value & gt; 500 then select Fonts Bold = True Line = Row + 1 'Loop, until it does not face an empty line, lane up to the loop (cell (row, 1)) = 0 end sub

P> Pure VBA approach:

  Public Sub AddMyRows () Dim LRow range as long as dim RNG , Range LRow = Category ("A" and Rows.Count) as cell. End (XLEEP) .roet RNG = Range ("C2: C" and LRO) RNG Formula = "= A2 + B2" cell for each cell in RGL. Font Bold = (cell.value> 500) Next cell & sub  

Screenshots:

An optional conditional formatting is there.

Hope this will be helpful.

Note: Block formula has been edited to reflect the comment of @Simoko regarding the code being replayed. This secures the code for that time when it needs to be run again. :)


Comments