Y
Yarroll
Hi,
I run a macro which checks if specific cells' font is bold. If it isn't,
then the whole row gets deleted. The lines in question read:
For k = howm To 2 Step -1 '(howm =
ActiveCell.SpecialCells(xlLastCell).Row )
If Cells(k, 12).Font.Bold = False Then
Rows(k).Delete
End If
Next
Macro works fine. But it operates on large number of workbooks, and a large
portion of these workbooks frequently have nothing whatsoever in bold (ie.,
everything, except header, gets deleted). My question: is it possible to
formulate a condition whereby the macro:
- first checks if a workbook has anything in bold,
- if there is, ( at least one Cells(k, 12).Font.Bold = True ) then the macro
proceeds as before, checks each and every row
- if nothing is in bold then everything is deleted right away.
I'm not sure if I dont beat around the bush here, namely, how can a macro
check if there is anything in bold in the workbook without going through
each and every one of cells? Still it seems like a waste of resources to
look at every Cells(k, 12) if a workbook always has nothing but Font.Bold =
False.
Thanks. Best regards
Yarroll
I run a macro which checks if specific cells' font is bold. If it isn't,
then the whole row gets deleted. The lines in question read:
For k = howm To 2 Step -1 '(howm =
ActiveCell.SpecialCells(xlLastCell).Row )
If Cells(k, 12).Font.Bold = False Then
Rows(k).Delete
End If
Next
Macro works fine. But it operates on large number of workbooks, and a large
portion of these workbooks frequently have nothing whatsoever in bold (ie.,
everything, except header, gets deleted). My question: is it possible to
formulate a condition whereby the macro:
- first checks if a workbook has anything in bold,
- if there is, ( at least one Cells(k, 12).Font.Bold = True ) then the macro
proceeds as before, checks each and every row
- if nothing is in bold then everything is deleted right away.
I'm not sure if I dont beat around the bush here, namely, how can a macro
check if there is anything in bold in the workbook without going through
each and every one of cells? Still it seems like a waste of resources to
look at every Cells(k, 12) if a workbook always has nothing but Font.Bold =
False.
Thanks. Best regards
Yarroll