franciscocorrea
New Member
- Joined
- Oct 31, 2012
- Messages
- 11
Hello everyone,
I want Column B to reflect the parent of Column A, using VBA. I think i should make an iteration, removing digits of Column A until the value is found in Column A. Here an example:
[TABLE="width: 200"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1111
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1222
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]122224
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I want the following outcome:
[TABLE="width: 200"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]1111
[/TD]
[TD]11
[/TD]
[/TR]
[TR]
[TD]12
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]1222
[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]122224
[/TD]
[TD]1222
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks!!
Best regards,
Francisco
I want Column B to reflect the parent of Column A, using VBA. I think i should make an iteration, removing digits of Column A until the value is found in Column A. Here an example:
[TABLE="width: 200"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1111
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1222
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]122224
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I want the following outcome:
[TABLE="width: 200"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]1111
[/TD]
[TD]11
[/TD]
[/TR]
[TR]
[TD]12
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]1222
[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]122224
[/TD]
[TD]1222
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks!!
Best regards,
Francisco