+ Reply to Thread
Results 1 to 6 of 6

data extraction from a series/column

  1. #1
    Registered User
    Join Date
    03-21-2010
    Location
    New Zealand
    MS-Off Ver
    Excel 365
    Posts
    46

    data extraction from a series/column

    I have a series of numbers - See below.
    I wish to count the 1's between the blanks.(Not the total 1's)

    0
    0
    0
    1
    1
    1
    1
    1
    1
    0
    1
    0
    1
    1
    1
    0
    0
    0
    1
    1
    1
    1
    0
    Etc.

    The answers I want are
    0
    0
    0
    1 1
    1 2
    1 3
    1 4
    1 5
    1 6*
    0
    1 1*
    0
    1 1
    1 2
    1 3*
    0
    0
    0
    1 1
    1 2
    1 3
    1 4*
    0
    Etc
    With the final result of 6, 1, 3, 4.

    Looking forward to your help.

    Cheers Sedge
    Last edited by Sedge; 05-05-2010 at 10:52 PM.

  2. #2
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: data extraction from a series/column

    Assuming column of numbers in A column:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-21-2010
    Location
    New Zealand
    MS-Off Ver
    Excel 365
    Posts
    46

    Re: data extraction from a series/column

    Thanks, nice to see, however I get an error message on this line??

    strOut = Left(strOut, Len(strOut) - 1)

    Can you help.

  4. #4
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: data extraction from a series/column

    Can you post a sample of your book - using your test data I receive no error.

    It would also be helpful if you included the error.

    One possibility is there were no non-zeros - was the error:
    "Run time error '5':
    Invalid procedure or argument"

  5. #5
    Registered User
    Join Date
    03-21-2010
    Location
    New Zealand
    MS-Off Ver
    Excel 365
    Posts
    46

    Re: data extraction from a series/column

    Opps, My Bad, I fixed it (I had a title in the macro)
    This works perfectly, much gratitude to you :-)

  6. #6
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: data extraction from a series/column

    Glad you got it sorted out. I did notice a minor error in the macro.
    Because of the space after the comma, the line you posted should be:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1