How many commas are there in a cell??


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How many commas are there in a cell??

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    How many commas are there in a cell??

    [Originally posted by Kousik]

    Hi,
    I am writing an Excel VBA macro. I would like to know how to know the number of commas are there in a cell. Each cell has text like this.
    Name, Address, City,State,Zip, Tel.
    but at times name/address fileds has data like˙ (name, Inc.,)/(1234, Center ct,).
    So if i know the total commas in the cell, then i can figure out how many commas are in name/address fields.

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:How many commas are there in a cell??

    [Originally posted by PraveenMenon]

    MsgBox UBound(Split(Text1.Text, ","))

    can retreive the number of commas in text1.text..

    All the best,
    Praveen Menon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center