• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 52
  • Last Modified:

Bold cell contents if the cell contents starts with a number using VBA

Dear Experts:

for the selected cells in a column (contiguous range) I would like to perform the following VBA Action.

If the macro hits a cell (of this selected range) which starts with a number, the macro is to bold the cell contents.

The cell contents are alphanumeric characters formatted as standard.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
0
AndreasHermle
Asked:
AndreasHermle
1 Solution
 
Rgonzo1971Commented:
Hi,

pls try
Sub macro()

For Each c In Selection
    If c Like "[0-9]*" Then
        c.Font.Bold = True
    End If
Next
End Sub

Open in new window

Regards
0
 
AndreasHermleAuthor Commented:
Hi Rgonzo,

as always great coding from your side.

thank you very much for your professional help. I really appreciate it.

Regards, Andreas
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now