Results 1 to 5 of 5

converting pseudocode to VBA

Threaded View

  1. #1
    Registered User
    Join Date
    03-15-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2007
    Posts
    5

    converting pseudocode to VBA

    I have a spreadsheet with 4 columns of information, then a column for a primary name, and then many columns of secondary names (with a different number of secondary names for each row).

    For rows with more than 1 secondary name, I need to create a new row with a copy of all the columns up to the secondary name for each secondary name in the row.


    A row in the spreadsheet looks like this:

    data data data data PrimaryName SecondaryName1 SecondaryName2 SecondaryName3... SecondaryNameN

    I need this row to be replaced by the following set of rows:

    data data data data PrimaryName SecondaryName1

    data data data data PrimaryName SecondaryName2

    data data data data PrimaryName SecondaryName3
    ...
    data data data data PrimaryName SecondaryNameN




    Here is some possible pseudo code for the algorithm:

    int curRow = 1
    IF (Cell(FcurRow)!=null)
    {
    * insert a duplicate of curRow below curRow
    * delete all columns after E for curRow
    * for the duplicated curRow (which is now curRow+1), shift over columns F through Z and make these columns E through Y
    }
    curRow++;
    Last edited by VBA Noob; 03-15-2009 at 02:33 PM.

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