Hi,
It's my first post here.
I have 2 tables in Excel that come from VBA data extraction from some other software.
I’d like for the common values in the NAME column on each table to be linked, meaning : if, for instance, I replaced ABC02 in the second table with ABC03 then the first table’s ABC02 would be replaced with ABC03 as well.
and conversely (a change in the first table would lead to a change in the second one).
I've tried using the Handle value to mark identical values with the following code:
Which gave this result:
But I don't know how to efficiently do it both ways (meaning getting the handles of similar values for the other table as well) to get that result:
and how to go from there (or even if I should do that at all ?)
I tried to be as clear as possible by including visuals but if there's anything I can clearify further, don't hesitate to tell me.
Thanks for reading and for any input.
It's my first post here.
I have 2 tables in Excel that come from VBA data extraction from some other software.
I’d like for the common values in the NAME column on each table to be linked, meaning : if, for instance, I replaced ABC02 in the second table with ABC03 then the first table’s ABC02 would be replaced with ABC03 as well.
and conversely (a change in the first table would lead to a change in the second one).
I've tried using the Handle value to mark identical values with the following code:
VBA Code:
Sub Test1()
Dim i, y As Integer
For i = 10 To 11
y = 7
Do Until y = 5
y = y - 1
If Range("C" & y).Value = Range("C" & i).Value Then
Range("D" & y).Value = Range("B" & i).Value
End If
Loop
'' Action :
Next i
End Sub
Which gave this result:
Test.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
3 | File1.dwg | |||||
4 | Blockname | Handle | NAME | |||
5 | Block1 | 386 | ABC02 | 27F | ||
6 | Block2 | 2F7 | ABC01 | 291 | ||
7 | Block3 | 267 | ||||
8 | File2.dwg | |||||
9 | Blockname | Handle | NAME | |||
10 | Block1 | 291 | ABC01 | |||
11 | Block2 | 27F | ABC02 | |||
TEST |
But I don't know how to efficiently do it both ways (meaning getting the handles of similar values for the other table as well) to get that result:
Test.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
3 | File1.dwg | |||||
4 | Blockname | Handle | NAME | |||
5 | Block1 | 386 | ABC02 | 27F | ||
6 | Block2 | 2F7 | ABC01 | 291 | ||
7 | Block3 | 267 | ||||
8 | File2.dwg | |||||
9 | Blockname | Handle | NAME | |||
10 | Block1 | 291 | ABC01 | 2F7 | ||
11 | Block2 | 27F | ABC02 | 386 | ||
Feuil6 |
and how to go from there (or even if I should do that at all ?)
I tried to be as clear as possible by including visuals but if there's anything I can clearify further, don't hesitate to tell me.
Thanks for reading and for any input.