catchthistank

New Member
Joined
Dec 31, 2012
Messages
2
I have to enter in manually the dates for E-H and update the matching vins manually. I have been trying to create a macro that would find all matching VIN's in column B and then fill in missing dates from E-H that have already been entered. I keep running into issues with the code I have been playing with:

Dim c As Range

For Each c In Range("B2", Range("B1048576").End(xlUp))
If c.Value <> c.Value = c.Offset(1, 3) Then
Range("E" & c.Row & ":H" & c.Row).Offset(-1).Copy
Cells(c.Row, 5).Insert Shift:=xlDown
End If
Next c


I would like to find all instances that match in Column B. Then, if there is data in Column E, of the previous matched data, I want it copied through all column E for the matching Vin's, etc. If there is information in column F, copy the data to all column F for the matching Vin's, etc. I want to do this through column H. Is it possible?

A
B
C
D
E
F
G
H
I
J
K
L
M
DC
VIN
MODEL
Product
MR DATE
OR DATE
OE DATE
DSI DATE
SSL
SSL BL
SVCCD
CMPLDT
SPDT
Q
2001
22
Things
8/23/2012
11/7/2012
11/7/2012
11/9/2012
Q
8/29/2012
11/27/2012
Q
2001
22
Things
8/23/2012
11/7/2012
PQ
8/23/2012
11/27/2012
Q
2001
22
Things
8/23/2012
11/7/2012
Q3
11/19/2012
11/27/2012
Q
2001
22
Things
8/23/2012
11/7/2012
11/9/2012
Q1
11/19/2012
11/27/2012
Q
2001
22
Things
8/23/2012
11/7/2012
11/7/2012
11/9/2012
PI
11/19/2012
11/27/2012
Q
2001
22
Things
11/7/2012
Q
11/19/2012
11/27/2012
Q
2001
22
Things
E45
11/20/2012
11/27/2012
Q
2001
22
Things
SD
11/27/2012
11/27/2012
Q
2002
22
Things
9/28/2012
12/11/2012
12/11/2012
12/11/2012
OP
12/12/2012
Q
2002
22
Things
9/28/2012
12/11/2012
S
9/28/2012
Q
2002
22
Things
PF
9/28/2012
Q
2002
22
Things
9/28/2012
12/11/2012
12/11/2012
PQ
9/28/2012
Q
2002
22
Things
12/11/2012
12/11/2012
PE
9/28/2012
Q
2002
22
Things
9/28/2012
12/11/2012
Q1
10/11/2012
Q
2002
22
Things
9/28/2012
12/11/2012
Q
10/11/2012
Q
2002
22
Things
9/28/2012
12/11/2012
Q1
12/14/2012
Q
2002
22
Things
9/28/2012
12/11/2012
Q
12/14/2012
Q
2002
22
Things
PI
12/14/2012
Q
2002
22
Things
Q3
12/14/2012
Q
2007
22
Things
8/23/2012
12/11/2012
12/11/2012
12/12/2012
OP
12/12/2012
Q
2007
22
Things
8/23/2012
12/11/2012
12/12/2012
PE
8/23/2012
Q
2007
22
Things
8/23/2012
12/11/2012
12/12/2012
PF
8/23/2012
Q
2007
22
Things
12/11/2012
12/11/2012
12/12/2012
S
8/23/2012
Q
2007
22
Things
8/23/2012
12/11/2012
12/12/2012
Q1
8/29/2012
Q
2007
22
Things
8/23/2012
12/11/2012
12/12/2012
Q
8/29/2012
Q
2007
22
Things
12/12/2012
PQ
8/23/2012
Q
2007
22
Things
12/11/2012
E45
11/20/2012
Q
2007
22
Things
8/23/2012
12/11/2012
12/12/2012
Q
12/14/2012
Q
2007
22
Things
12/11/2012
12/12/2012
Q3
12/14/2012
Q
2007
22
Things
8/23/2012
12/11/2012
Q1
12/14/2012
Q
2007
22
Things
8/23/2012
PI
12/14/2012
Q
2007
22
Things
9/21/2012
12/11/2012
12/11/2012
12/12/2012
OP
12/12/2012
Q
4982
22
Things
12/11/2012
12/11/2012
12/12/2012
PE
9/21/2012
Q
4982
22
Things
9/21/2012
PF
9/21/2012
Q
4982
22
Things
9/21/2012
12/11/2012
S
9/21/2012
Q
4982
22
Things
12/11/2012
12/12/2012
PQ
9/21/2012
Q
4982
22
Things
12/12/2012
Q1
9/25/2012
Q
4982
22
Things
12/11/2012
12/11/2012
Q
9/25/2012
Q
4982
22
Things
12/12/2012
PI
12/14/2012
Q
4982
22
Things
9/21/2012
12/11/2012
12/11/2012
12/12/2012
Q
12/14/2012
Q
4982
22
Things
12/11/2012
12/11/2012
12/12/2012
Q3
12/14/2012
Q
4982
22
Things
9/21/2012
12/11/2012
12/12/2012
Q1
12/14/2012
Q
AF45W
24
Things
9/28/2012
OP
12/18/2012
Q
3563
24
Things
9/28/2012
OP
12/17/2012
Q
D4H6Y
24
Things
9/28/2012
OP
12/12/2012
Q
D4H6Y
24
Things
9/28/2012
11/7/2012
11/7/2012
11/9/2012
PF
11/30/2012
Q
D4H6Y
24
Things
9/28/2012
11/7/2012
11/7/2012
PE
11/30/2012
Q
D4H6Y
24
Things
9/28/2012
11/7/2012
11/7/2012
PQ
11/30/2012
Q
D4H6Y
24
Things
11/7/2012
11/7/2012
S
11/30/2012
Q
D4H6Y
24
Things
9/28/2012
11/7/2012
11/9/2012
Q1
12/10/2012
Q
D4H6Y
24
Things
9/28/2012
11/9/2012
Q
12/10/2012
Q
D4H6Y
24
Things
11/7/2012
11/7/2012
Q1
12/18/2012
Q
D4H6Y
24
Things
12/11/2012
Q3
12/18/2012
Q
D4H6Y
24
Things
8/23/2012
12/11/2012
Q
12/18/2012
Q
D4H6Y
24
Things
8/23/2012
12/11/2012
12/11/2012
PI
12/18/2012
Q
G843J
34
Things
8/23/2012
12/11/2012
OP
12/11/2012
12/19/2012
Q
G843J
34
Things
12/11/2012
12/11/2012
PQ
11/28/2012
12/19/2012
Q
G843J
34
Things
8/23/2012
12/11/2012
PF
11/28/2012
12/19/2012
Q
G843J
34
Things
8/23/2012
12/11/2012
PE
11/28/2012
12/19/2012
Q
G843J
34
Things
8/23/2012
12/11/2012
S
11/28/2012
12/19/2012
Q
G843J
34
Things
12/11/2012
12/11/2012
12/11/2012
Q1
12/6/2012
12/19/2012
Q
G843J
34
Things
8/23/2012
12/11/2012
12/11/2012
Q
12/6/2012
12/19/2012
Q
G843J
34
Things
8/23/2012
12/11/2012
12/11/2012
Q1
12/14/2012
12/19/2012
Q
G843J
34
Things
Q3
12/14/2012
12/19/2012
Q
G843J
34
Things
8/23/2012
12/11/2012
12/11/2012
12/12/2012
Q
12/14/2012
12/19/2012
Q
G843J
34
Things
9/21/2012
12/11/2012
PI
12/14/2012
12/19/2012
Q
G843J
34
Things
12/11/2012
12/11/2012
12/12/2012
SD
12/19/2012
12/19/2012
Q
GF984J
34
Things
12/11/2012
12/11/2012
12/12/2012
OP
11/29/2012
12/11/2012
Q
GF984J
34
Things
9/21/2012
12/11/2012
12/12/2012
S
11/28/2012
12/11/2012
Q
GF984J
34
Things
12/11/2012
PF
11/28/2012
12/11/2012
Q
GF984J
34
Things
12/11/2012
PQ
11/28/2012
12/11/2012
Q
GF984J
34
Things
12/11/2012
12/12/2012
PE
11/28/2012
12/11/2012
Q
GF984J
34
Things
PI
11/30/2012
12/11/2012
Q
GF984J
34
Things
9/21/2012
12/11/2012
12/12/2012
Q3
11/30/2012
12/11/2012
Q
GF984J
34
Things
9/21/2012
12/11/2012
Q
11/30/2012
12/11/2012
Q
GF984J
34
Things
12/11/2012
12/12/2012
Q1
11/30/2012
12/11/2012
Q
GF984J
34
Things
12/11/2012
SD
12/11/2012
12/11/2012

<tbody>
</tbody>


Thank you in advance,
Rob
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

catchthistank

New Member
Joined
Dec 31, 2012
Messages
2
Got it! It even includes the column M in the population.

Sub CompleteDates()
Dim a, i As Long, ii As Long, w
With Range("a1").CurrentRegion
a = .Value: ReDim w(1 To 5)
With CreateObject("Scripting.Dictionary")
For i = 2 To UBound(a, 1)
If Not .exists(a(i, 2)) Then
For ii = 5 To 8
w(ii - 4) = a(i, ii)
Next
w(5) = a(i, 13)
.Item(a(i, 2)) = w
Else
w = .Item(a(i, 2))
For ii = 5 To 8
If w(ii - 4) = "" Then w(ii - 4) = a(i, ii)
Next
If w(5) = "" Then w(5) = a(i, 13)
.Item(a(i, 2)) = w
End If
Next
For i = 2 To UBound(a, 1)
For ii = 5 To 8
a(i, ii) = .Item(a(i, 2))(ii - 4)
Next
a(i, 13) = .Item(a(i, 2))(5)
Next
End With
.Value = a
End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,233
Messages
5,594,964
Members
413,955
Latest member
FalcoDaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top