+ Reply to Thread
Results 1 to 4 of 4

Converting Each line to 4 line (to preparing data to make a discrete choice model)

  1. #1
    Registered User
    Join Date
    05-21-2012
    Location
    Tehran, Iran
    MS-Off Ver
    Excel 2007
    Posts
    6

    Converting Each line to 4 line (to preparing data to make a discrete choice model)

    Dear friends,
    I hope you have a good time.

    I have attached a xlsx file. this file contain 2 worksheets. In work sheet "basic" I want to add 3 line after each line and inserting the amount of YC , Yd, YT in them. The amount of other columns (E to O) will be the same for each 4 line. I have done this procedure for line 2 and put it in worksheet "converted" as an example.

    I dont know how to do this procedure for all lines and I'm really sorry to bother you. Would you mind helping me?

    Thanks alot
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Converting Each line to 4 line (to preparing data to make a discrete choice model)

    Like so:

    Please Login or Register  to view this content.

    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook (.xlsm)

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-21-2012
    Location
    Tehran, Iran
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Converting Each line to 4 line (to preparing data to make a discrete choice model)

    thank you JBeaucaire , It's amazing

    Quote Originally Posted by JBeaucaire View Post
    Like so:

    Please Login or Register  to view this content.

    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook (.xlsm)

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.

  4. #4
    Registered User
    Join Date
    06-27-2012
    Location
    Lincoln, NE
    MS-Off Ver
    2013
    Posts
    5

    Re: Converting Each line to 4 line (to preparing data to make a discrete choice model)

    What modifications should be applied to the code, if I want to do the same thing to the same file, but for the first two columns (instead of the first four columns)?

+ 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