Solved

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

Posted on 2016-12-02
2
41 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

623 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