+ Reply to Thread
Results 1 to 2 of 2

Duplicate Row and Edit Values Within Table

Hybrid View

  1. #1
    Registered User
    Join Date
    01-29-2018
    Location
    Toronto
    MS-Off Ver
    MS Office 2013
    Posts
    17

    Duplicate Row and Edit Values Within Table

    Hi I currently track sales activities that are sometimes performed by more than one sales person. As you can see in the attached the Sales Person (Column B) will occasionally have a "/" to define the multiple persons involved.
    Issue: The code I have so far places the duplicated row directly beneath the original row (See Screenshots), and since my data is formatted as a Table, I receive Error 1004. Could someone advise as how to changing the code to placing the duplicate row(s) beneath the entire table. Or alternatively, another solution to get around the Error 1004.

    Thank you in advance!

    Sub Procedure1()
     Dim S As String, r As Long, Z, n As Long
        r = 4: Do Until Cells(r, 4) = "": S = Cells(r, 4): Z = Split(S, "/")
                If UBound(Z) Then
        Cells(r + 1, 1).Resize(UBound(Z), 20).Insert: Cells(r, 4) = Z(0)
        For n = 1 To UBound(Z): Cells(r + n, 1).Resize(1, 20).Value = _
        Cells(r, 1).Resize(1, 20).Value: Cells(r + n, 4).Value = Z(n)
        Next n: r = r + n
                Else: r = r + 1: End If: n = 0: Loop
    End Sub
    example.JPG

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Duplicate Row and Edit Values Within Table


    Hi !

    As least join a workbook attachment …

+ 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. Pivot Table Without Duplicate Values
    By hthoma11 in forum Excel Charting & Pivots
    Replies: 13
    Last Post: 08-17-2016, 07:35 AM
  2. Replies: 4
    Last Post: 02-18-2015, 10:03 AM
  3. Look up for duplicate values in column table
    By boboivan in forum Excel General
    Replies: 2
    Last Post: 01-28-2015, 07:18 AM
  4. Pivot Table - Edit displayed values
    By jakethepeg1 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-28-2014, 05:47 AM
  5. [SOLVED] Macro that merges duplicate rows based on unique values - Need to edit current code
    By niya429 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2014, 02:57 PM
  6. Large Table with Duplicate Values - Minimum Value Needed
    By kma27 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-28-2012, 10:10 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