+ Reply to Thread
Results 1 to 3 of 3

To add rows and columns depending on values in cell

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    To add rows and columns depending on values in cell

    Hello everyone,

    I am Kamps trying to learn macro for some excel based operations. I am an operations analyst and would really appreciate the help!

    New to excel sheet programming.

    Tab 1 has the following questions and similar column names are created in Tab 2:

    Folder Name:
    Tenant Name:
    Cust ID:
    Number of Brands:
    (depending on number of brands, Tab 2 gets the number of columns & Tab 1 gets the number of rows named - Brand 1 Brand 2...so on with a condition that everytime the row is created a question on sub brand is asked & then corresponding rows and columns are made)
    Brand 1:
    Number of Sub-brands:
    Sub Brand:
    Brand 2:
    --
    --
    Then i have to assign certain communities & users to each brand and sub brand and ofcourse they have their own columns and rows generated in tab 2 and tab 1 respectively.

    I know its too much of an requirement and would really help if there is a similar example or similar case from where i can take the reference.

    Would really appreciate the help.
    Thanks!
    Last edited by vlady; 01-22-2013 at 09:20 PM.

  2. #2
    Registered User
    Join Date
    01-21-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: To add rows and columns depending on values in cell

    it will be better if you can show us a sample. thanks.

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: To add rows and columns depending on values in cell

    For eg:

    Sheet 1 has the following data:

    Tenant PQR
    No of Brands 2
    Brand 1 XYZ
    No of SubBrands 2
    Sub Brand 11 ABC
    No of subBrands 2
    Sub Brand 111 VWX
    No of subBrands 0
    Sub Brand 112 STU
    No of subBrands 0
    Sub Brand 12 DEF
    No of subBrands 0
    Brand 2 JKL
    No of SubBrands 1
    Sub Brand 21 MNO
    No of subBrands 0

    Sheet 2 has the following data:
    Tenant Brand Sub Brands Sub Brands
    PQR XYZ ABC VWX
    STU
    DEF
    JKL MNO

    So depending on the question "No of Brands" in Sheet 1, Brand rows "Brand 1" n "Brand 2" are created. At the same time, Brand 1 & Brand 2 values are created in Sheet 2 column "Brand".

    Once Brand 1 row is created, next row should appear asking for "No of SubBrands" and similar logic should apply creating the resulting rows.
    The corresponding values will appear under "SubBrands" in Sheet 2

    The values are displayed in corresponding fashion.

    This thing can continue as a loop until sub brands within subbrands are created.

    I hope this example helps Also attaching the excel sheet
    Attached Files Attached Files

+ 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