noobstarrr
New Member
- Joined
- May 6, 2019
- Messages
- 3
Hello, I have a sheet of data where column one is a list of names and column two is a list of dates. Some names have multiple dates (multiple entries). I need help writing a macro that copies and pastes the rows of data onto a new sheets and if a name is repeated the rows are pasted together on a single line. Here is an example of what I mean:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]var1[/TD]
[TD]var2[/TD]
[TD]var3[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]1/2/18[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]
[/TD]
[TD]d[/TD]
[TD]e[/TD]
[TD]f[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]
[/TD]
[TD]g[/TD]
[TD]h[/TD]
[TD]i[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]
[/TD]
[TD]j[/TD]
[TD]k[/TD]
[TD]l[/TD]
[/TR]
[TR]
[TD]Kelly[/TD]
[TD]
[/TD]
[TD]m[/TD]
[TD]n[/TD]
[TD]o[/TD]
[/TR]
[TR]
[TD]Kelly[/TD]
[TD]
[/TD]
[TD]p[/TD]
[TD]q[/TD]
[TD]r[/TD]
[/TR]
</tbody>[/TABLE]
Would yield:
[TABLE="width: 500"]
<tbody>[TR]
[TD]
[/TD]
[TD]<strike></strike>
[/TD]
[TD]<strike></strike>
[/TD]
[TD]<strike></strike>
[TD]<strike></strike>
[/TD]
[TD]date.2[/TD]
[TD]<strike></strike>
[TD]<strike></strike>
[/TD]
[TD]<strike></strike>
[TD]date.3[/TD]
[TD]<strike></strike>
[TD]<strike></strike>
[/TD]
[TD]<strike></strike>
[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]
[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]
[/TD]
[TD]d[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD]
[/TD]
[TD]g[/TD]
[TD]h[/TD]
[TD]i[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]
[/TD]
[TD]j[/TD]
[TD]k[/TD]
[TD]l[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kelley[/TD]
[TD]
[/TD]
[TD]m[/TD]
[TD]n[/TD]
[TD]o[/TD]
[TD]
[/TD]
[TD]p[/TD]
[TD]q[/TD]
[TD]r[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
None of the names have more than 3 entries. I have searched high and low and don't have enough experience myself to write the macro so any help is much appreciated!
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]var1[/TD]
[TD]var2[/TD]
[TD]var3[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]1/2/18[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]
6/2/18
<strike></strike>[/TD]
[TD]d[/TD]
[TD]e[/TD]
[TD]f[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]
12/2/18
<strike></strike>[/TD]
[TD]g[/TD]
[TD]h[/TD]
[TD]i[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]
5/2/18
<strike></strike>[/TD]
[TD]j[/TD]
[TD]k[/TD]
[TD]l[/TD]
[/TR]
[TR]
[TD]Kelly[/TD]
[TD]
2/2/18
<strike></strike>[/TD]
[TD]m[/TD]
[TD]n[/TD]
[TD]o[/TD]
[/TR]
[TR]
[TD]Kelly[/TD]
[TD]
3/2/18
<strike></strike>
[/TD]
[TD]p[/TD]
[TD]q[/TD]
[TD]r[/TD]
[/TR]
</tbody>[/TABLE]
Would yield:
[TABLE="width: 500"]
<tbody>[TR]
[TD]
Name
<strike></strike>[/TD]
[TD]<strike></strike>
Date.1
<strike></strike>[/TD]
[TD]<strike></strike>
var1.1
<strike></strike>[/TD]
[TD]<strike></strike>
var2.1
[/TD][TD]<strike></strike>
var3.1
<strike></strike>[/TD]
[TD]date.2[/TD]
[TD]<strike></strike>
var1.2
[/TD][TD]<strike></strike>
var2.2
<strike></strike>[/TD]
[TD]<strike></strike>
var3.2
[/TD][TD]date.3[/TD]
[TD]<strike></strike>
var1.3
[/TD][TD]<strike></strike>
var2.3
<strike></strike>[/TD]
[TD]<strike></strike>
var3.3
<strike></strike>[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]
1/2/18
<strike></strike>[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]
6/2/18
<strike></strike>[/TD]
[TD]d[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD]
12/2/18
<strike></strike>[/TD]
[TD]g[/TD]
[TD]h[/TD]
[TD]i[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]
5/2/18
<strike></strike>[/TD]
[TD]j[/TD]
[TD]k[/TD]
[TD]l[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kelley[/TD]
[TD]
3/2/18
<strike></strike>[/TD]
[TD]m[/TD]
[TD]n[/TD]
[TD]o[/TD]
[TD]
3/2/18
<strike></strike>[/TD]
[TD]p[/TD]
[TD]q[/TD]
[TD]r[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
None of the names have more than 3 entries. I have searched high and low and don't have enough experience myself to write the macro so any help is much appreciated!