Results 1 to 6 of 6

Thread: combine cells

  1. #1

    combine cells



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I have two columns one is product SKU's the other is the product fitment. If a sku has more then one fitment it repeats the sku and adds the fitment. I want some way of finding all matching skus and combining the fitments into one sku.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Untitled1.png 
Views:	11 
Size:	12.0 KB 
ID:	3519   Click image for larger version. 

Name:	Untitled2.png 
Views:	8 
Size:	6.2 KB 
ID:	3520  

  2. #2
    The first image shows what my data looks like. the second what i need it to look like

  3. #3
    Conjurer snb's Avatar
    Join Date
    May 2013
    Posts
    375
    Articles
    0
    Excel Version
    2020
    But your Excel file is missing.

  4. #4
    example.xlsx please see this example

  5. #5
    I updated the example the first page shows example data the second page shows what i would like it to look like when done
    Attached Files Attached Files

  6. #6
    Acolyte jaslake's Avatar
    Join Date
    Aug 2011
    Location
    mineral city oh usa
    Posts
    81
    Articles
    0
    Excel Version
    2007;2010;MAc2011
    Hi painnbt

    Try this
    Code:
    Option Explicit
    Sub test()
       Dim ws As Worksheet
       Dim LR As Long, i As Long
       Set ws = Sheets("Before")
       Application.ScreenUpdating = False
       With ws
          LR = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
                           SearchDirection:=xlPrevious).Row
          For i = LR To 2 Step -1
             If .Range("A" & i).Offset(-1, 0).Value = .Range("A" & i).Value Then
                .Range("B" & i).Offset(-1, 0).Value = .Range("B" & i).Offset(-1, 0).Value & " | " & .Range("B" & i).Value
                .Range("A" & i).EntireRow.Delete
             End If
          Next i
       End With
       Application.ScreenUpdating = True
    End Sub
    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •