?
Solved

Excel-count character in cel

Posted on 2011-05-11
9
Medium Priority
?
329 Views
Last Modified: 2012-05-11
For a column I want to highlight cell that are more then 40 character ? The macro should work for a column only and not whole worksheet.

thak you for your help.
0
Comment
Question by:sud
7 Comments
 
LVL 1

Expert Comment

by:ISO30
ID: 35740497
Version of Excel?
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 1000 total points
ID: 35740703
This will do it for the column in which the cursor is

Sub highlightlong()
For Each cel In ActiveCell.EntireColumn.Cells
If Len(cel.Value) > 40 Then cel.Interior.ColorIndex = 6
Next cel
End Sub
0
 
LVL 10

Assisted Solution

by:answer_dude
answer_dude earned 1000 total points
ID: 35741519
You can do this with conditional formatting.

1. Highlight the cells where you want it
2. choose "Format - Conditional Formatting"
3. Change condition1 to say "Formula Is"
4. Type in "=LEN(A2)>40" (without the quotes & replace "A2" with the first cell in your column)
5. Choose a format by clicking on the format button
6. Press OK
0
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!

 
LVL 33

Expert Comment

by:jppinto
ID: 35741547
You can do it simply by using a Conditional Formatting on that column with a rule where you put a formula like this:

=LEN(A1)>40

Please take a look at the attached image and sample file.

jppinto
Capturar.JPG
Conditional-Formatting-LEN.xls.xlsx
0
 
LVL 50
ID: 36315288
I've requested that this question be closed as follows:

Accepted answer: 500 points for answer_dude's comment http:/Q_27032341.html#35741519

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 36315286
The OP asked for a macro so that is what I gave. I should at least get a split....unless the OP changes his mind.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 36315289
As above
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!

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
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 will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

850 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