+ Reply to Thread
Results 1 to 3 of 3

Converting a row into multiple rows

Hybrid View

  1. #1
    Registered User
    Join Date
    07-11-2013
    Location
    Tehran
    MS-Off Ver
    Excel 2003
    Posts
    14

    Converting a row into multiple rows

    Very emergency
    I have a worksheet with one column and 96 rows of data. I want to convert each row into 62 rows with the same value,

    eg:

    Row1: 2342
    Row2: 4351
    .
    .
    .
    .
    In other words I want 62 rows with the value of "2341" and below that, another 62 rows with the value of "4351" and so on. (instead of 96 rows I want 96*62 rows).

    please help

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Converting a row into multiple rows

    try
    Sub MultiplyRows()
        Const multi As Long = 62
        
        Dim aData, i&, j&
        aData = Cells(1).CurrentRegion.Value
        j = 1
        For i = LBound(aData, 1) To UBound(aData, 1)
            Cells(j, 1).Resize(multi).Value = aData(i, 1)
            j = j + multi
        Next i
    End Sub
    where multi is the number of rows you want and your data starts in row 1 and has no blanks till the last row of data. Values will be replaced in place
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    07-11-2013
    Location
    Tehran
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Converting a row into multiple rows

    Thank you so much, That was very helpful

+ 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