I have two worksheets- Sheet1 and Sheet2
In Sheet1, I want to count the number of row are not bold. And I want to show this count in a cell in Sheet2.
I currently have something like this:
But the macro is returning me the count of all the rows instead, including the bold ones.![]()
Dim cnt as Integer cnt = Range("G1").CurrentRegion.Rows.Count For Each Row In Range("G1") If Row.Font.Bold = True Then cnt = cnt + 0 End If Next Application.Goto (ActiveWorkbook.Sheets("Sheet2").Range("B2")) ActiveCell.Value = cnt
How should I change the macro?
Thanks!
Moderator's note: Code tags added for you - this time![]()
Bookmarks