Code Help????

  • Thread starter Thread starter dkenebre
  • Start date Start date
D

dkenebre

How do I create a macro starting with row 80 that will match the 3 digi
combinations
in columns A:C and O:Q to the 3 digit combinations in A5:C30, wher
there is a match
and also, data in the corresponding cell in X5:X30, place that dat
from the X cell into
the corresponding cell in G or S, starting with row 80.
Also, I believe in the future I will need to add additional location
to find matches and
its data, then add the additional data to what is already listed in th
destignation cell.
So it would be helpful to know which cells to copy and update t
enhance the code

example1:
If
A80:C80=0,4,9
match found in
A7:C7=0,4,9
and
X7=904,049
then Answer: place 904, 049 into G80
G80=904, 04
 
Something to get you started:

Sub MatchCols()
For i = Range("a80").Row To Range("a80").End(xlDown).Row
For j = 5 To 30
If Cells(i, 1) = Cells(j, 1) And Cells(i, 2) = Cells(j, 2) _
And Cells(i, 3) = Cells(j, 3) Then
Cells(i, 7).Value = Cells(j, 24)
Exit For
End If
Next j
Next i

For k = Range("o80").Row To Range("o80").End(xlDown).Row
For l = 5 To 30
If Cells(k, 15) = Cells(l, 1) And Cells(k, 16) = Cells(l, 2) _
And Cells(k, 17) = Cells(l, 3) Then
Cells(k, 19).Value = Cells(l, 24)
Exit For
End If
Next l
Next k
End Sub

How do I create a macro starting with row 80 that will match the 3 digit
combinations
in columns A:C and O:Q to the 3 digit combinations in A5:C30, where
there is a match
and also, data in the corresponding cell in X5:X30, place that data
from the X cell into
the corresponding cell in G or S, starting with row 80.
Also, I believe in the future I will need to add additional locations
to find matches and
its data, then add the additional data to what is already listed in the
destignation cell.
So it would be helpful to know which cells to copy and update to
enhance the code

example1:
If
A80:C80=0,4,9
match found in
A7:C7=0,4,9
and
X7=904,049
then Answer: place 904, 049 into G80
G80=904, 049
 
Back
Top