Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 127
Default Count funtion

Please I have a column of middle names. Most middle names are 1 character and
some are more than 1 character. Is there a formula that can help me know if
some middle names are more than 1 character and possible highlight or color.

All help totally appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Count funtion

On May 11, 11:08*pm, Yossy wrote:
Please I have a column of middle names. Most middle names are 1 character and
some are more than 1 character. Is there a formula that can help me know if
some middle names are more than 1 character and possible highlight or color.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Count funtion

if they're all in a separate column, maybe this will help. i used sheet1 and
column B in my example.

Sub test()
Dim ws As Worksheet
Dim lastrow As Long
Dim rng As Range
Dim cell As Range
Dim cntr As Long
Set ws = Worksheets("Sheet1")
lastrow = ws.Cells(Rows.Count, "B").End(xlUp).Row
Set rng = ws.Range("b2:B" & lastrow)

For Each cell In rng
If Len(cell) 1 Then
cell.Interior.ColorIndex = 19
cntr = cntr + 1
Else
cell.Interior.ColorIndex = 0
End If
Next
MsgBox cntr & " names with more than 1 character."
End Sub


--


Gary


"Yossy" wrote in message
...
Please I have a column of middle names. Most middle names are 1 character and
some are more than 1 character. Is there a formula that can help me know if
some middle names are more than 1 character and possible highlight or color.

All help totally appreciated.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count comments funtion [email protected] Excel Programming 12 January 11th 08 08:14 PM
Count funtion in Pivot Table Aussie Mick F Excel Discussion (Misc queries) 3 February 7th 07 09:47 AM
If Funtion David Excel Worksheet Functions 4 November 29th 05 08:09 PM
Formula format for Count or Countif funtion with two criterias Debi Excel Worksheet Functions 2 September 26th 05 08:23 PM
IF funtion viddom Excel Discussion (Misc queries) 2 June 30th 05 02:53 PM


All times are GMT +1. The time now is 06:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"