+ Reply to Thread
Results 1 to 7 of 7

How to increment column?

  1. #1
    Registered User
    Join Date
    05-07-2004
    Posts
    33

    How to increment column?

    I'm creating an Excel 2007 macro to manipulate the file data. How do I increment/decrement the column to the next or before?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    If a cell in Col A is selected this would select Col B

    Please Login or Register  to view this content.
    However you should avoid selecting if possible so tell us what your trying to do

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    05-07-2004
    Posts
    33
    I want to increment the column so that for the following scenero. Currently our excel document have two or three rows because this couple have two or three children. The parent's ID is the same and because of the number of children this couple have, they have duplicate records by showing more than one row. So what I wanted to do is, if it is duplicate, I want to copy just the child's name, birtday, school etc. and append it to the end of the first row of the parent's row. So in this case, I need to be able to increment the column name so that it will work with couples who have more than just two or three kids. Each child's will be append to the same row as the parent one after another.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hard to tell what your after. Can you post a small example (Before and after would be good)

    VBA Noob

  5. #5
    Registered User
    Join Date
    05-07-2004
    Posts
    33
    Okay, here's what I wanted.

    Original data:
    1 parentName child1
    1 parentName child2
    2 parentName2 child1
    2 parentName2 child2
    2 parentName2 child3

    And I wanted to look like is:

    1 parentName child1 child2
    2 parentName2 child1 child2 child3

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try a pivot table

    VBA Noob
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-07-2004
    Posts
    33
    Pivot table is definitely not the answer here. I'm not looking to add anything or create any table. The child1, childe2, child3 are actual names(characters). There are not numbers. Again, what I wanted to do is take the children's name from the duplicated record and append it to the end of the first existing record's row. Do you see what I'm trying to do here? I'm not trying to add children.

    Can you just tell me how to increment the column please if you know how?

+ 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