# data repetition

• ### Question

• I have a table with data. I want data to be repeated in cells when there is a repetition in particular column from another column like below.

regards

dockhem

Friday, August 29, 2014 2:04 PM

• ```Sub Test()
Dim D As Range, C As Range
'For each value in column D
For Each D In Range("D2", Range("D" & Rows.Count).End(xlUp))
'Search in column C
Set C = Columns("C").Find(D, LookIn:=xlValues, LookAt:=xlWhole)
'Found?
If Not C Is Nothing Then
'Copy columns E:I from row of C into row of D
Intersect(Range("E:I"), C.EntireRow).Copy Intersect(Range("E:I"), D.EntireRow)
End If
Next
End Sub
```

Saturday, August 30, 2014 4:14 PM
• Hi Dockhem,

The solution provied by Andreas suppose the data you provided in the sample is stated with column A and it works well for me. If the context is different, you can modify the column as fingure below:

Range.Find Method

Application.Intersect Method (Excel)

Welcome to the Excel 2013 developer reference

Best regards

Fei

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Tuesday, September 9, 2014 9:25 AM

### All replies

• ```Sub Test()
Dim D As Range, C As Range
'For each value in column D
For Each D In Range("D2", Range("D" & Rows.Count).End(xlUp))
'Search in column C
Set C = Columns("C").Find(D, LookIn:=xlValues, LookAt:=xlWhole)
'Found?
If Not C Is Nothing Then
'Copy columns E:I from row of C into row of D
Intersect(Range("E:I"), C.EntireRow).Copy Intersect(Range("E:I"), D.EntireRow)
End If
Next
End Sub
```

Saturday, August 30, 2014 4:14 PM
• Hi,

Thank you,

I am sorry I could find result with this could.

regards,

dockhem

Sunday, August 31, 2014 8:47 AM
• Hi Dockhem,

The solution provied by Andreas suppose the data you provided in the sample is stated with column A and it works well for me. If the context is different, you can modify the column as fingure below:

Range.Find Method

Application.Intersect Method (Excel)

Welcome to the Excel 2013 developer reference

Best regards

Fei

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.