Detect bold text in MS Excel
November 2, 2008 2:36 PM Subscribe
I have a very large MS Excel spreadsheet in Mac Office 2008 (yuk). I want to find every cell that contains bold text and append an asterisk to it -- i.e. "bold cell text" becomes "bold cell text*". I can probably find a Windows machine if necessary. How can this be done automatically?
Response by poster: Perfect! Thanks pompomtom, you just saved me hours of typing.
posted by beniamino at 3:14 PM on November 2, 2008
posted by beniamino at 3:14 PM on November 2, 2008
You should change "Cells" to "UsedRange" so it only looks at cells that are actually used.
Excel maintains a hidden "used range". You can tell its extent if you press CTRL+END, which takes you to the lower-right corner of the used range.
posted by zixyer at 3:34 PM on November 2, 2008 [1 favorite]
Excel maintains a hidden "used range". You can tell its extent if you press CTRL+END, which takes you to the lower-right corner of the used range.
posted by zixyer at 3:34 PM on November 2, 2008 [1 favorite]
And one tiny, tiny nit, which I'm only going to pick because I see it all over the place and I've become allergic to it:
Testing a Boolean value for equality with True is redundant. Instead of
you can simply use
posted by flabdablet at 7:00 PM on November 2, 2008 [1 favorite]
Testing a Boolean value for equality with True is redundant. Instead of
If c.Font.Bold = True Then
you can simply use
If c.Font.Bold Then
posted by flabdablet at 7:00 PM on November 2, 2008 [1 favorite]
This thread is closed to new comments.
If you know the extent of your spreadsheet, you can change "Cells" to "Range("A1:Z10000") or something to speed it up.
...alternatively - if you also want to de-boldify as per your example text, use: posted by pompomtom at 3:01 PM on November 2, 2008 [1 favorite]