+ Reply to Thread
Results 1 to 8 of 8

replication

Hybrid View

  1. #1
    Registered User
    Join Date
    12-19-2013
    Location
    Mineapolis, Minnesota, US
    MS-Off Ver
    Excel 2007
    Posts
    15

    replication

    Hi,

    I have thousands of rows, just one column.

    Basically I want to transform from
    A
    B
    C


    to

    equivalent rows of each cell; e.g.
    A
    A
    A
    B
    B
    B
    C
    C
    C

    Do I need to write Macro to accomplish that? Sorry, I am new to Macro.3

    Thanks so much.

    Wei
    Attached Files Attached Files

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: replication

    Public Sub AddRows()
    Dim lastrow As Long
    Dim i As Long
    
        Application.ScreenUpdating = False
        
        With ActiveSheet
        
            lastrow = .Cells(.Rows.Count, "B").End(xlUp).Row
            For i = lastrow To 5 Step -1
            
                .Rows(i + 1).Resize(2).Insert
                .Cells(i, "B").Resize(3).Value = .Cells(i, "B").Value
            Next i
        End With
    
        Application.ScreenUpdating = True
    End Sub

  3. #3
    Registered User
    Join Date
    12-19-2013
    Location
    Mineapolis, Minnesota, US
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: replication

    Thanks so much, Bob. It works.

    Quote Originally Posted by Bob Phillips View Post
    Public Sub AddRows()
    Dim lastrow As Long
    Dim i As Long
    
        Application.ScreenUpdating = False
        
        With ActiveSheet
        
            lastrow = .Cells(.Rows.Count, "B").End(xlUp).Row
            For i = lastrow To 5 Step -1
            
                .Rows(i + 1).Resize(2).Insert
                .Cells(i, "B").Resize(3).Value = .Cells(i, "B").Value
            Next i
        End With
    
        Application.ScreenUpdating = True
    End Sub

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: replication

    Your use of letters is probably just an example, but this will also do it for you without VBA.

    Enter A in A3, then use this, copied down...
    =IF(MOD(ROW(),3)<>0,AG3,CHAR(CODE(A3)+1))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    12-19-2013
    Location
    Mineapolis, Minnesota, US
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: replication

    Thanks very much. It also works.

    Quote Originally Posted by FDibbins View Post
    Your use of letters is probably just an example, but this will also do it for you without VBA.

    Enter A in A3, then use this, copied down...
    =IF(MOD(ROW(),3)<>0,AG3,CHAR(CODE(A3)+1))

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: replication

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

  7. #7
    Registered User
    Join Date
    12-19-2013
    Location
    Mineapolis, Minnesota, US
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: replication

    Hi FDibbins, I have marked it as solved and clicked on the star. Thanks again

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: replication

    Thank you, always appreciated

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Data Replication
    By mcmuney in forum Excel General
    Replies: 11
    Last Post: 11-02-2010, 02:00 PM
  2. Automatic Replication
    By Dr Stupid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-08-2008, 09:05 AM
  3. record replication ?
    By qhorse in forum Excel General
    Replies: 0
    Last Post: 08-02-2005, 05:12 AM
  4. [SOLVED] Excel self replication - help !
    By Gniff! in forum Excel General
    Replies: 1
    Last Post: 05-08-2005, 06:06 PM
  5. Replication of formula
    By Ken Scanlon in forum Excel General
    Replies: 9
    Last Post: 02-20-2005, 02:33 PM

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