Solved

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

Posted on 2016-12-02
2
35 Views
Last Modified: 2016-12-02
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
Comment
Question by:AndreasHermle
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41909876
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
 

Author Closing Comment

by:AndreasHermle
ID: 41909896
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

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question