cmondeau
Board Regular
- Joined
- Sep 23, 2014
- Messages
- 86
Greetings all!
I am having a hard time finding some code for a table generator in VBA. What I'd like to do is create a table using the unique colors and animals as row & column headers. Eventually I would like to have the table filled with the number for each combination (tried countifs, but was curious about using vlookup). I'm lost, because this seems so simple, yet I think I keep convoluting it...
I am having a hard time finding some code for a table generator in VBA. What I'd like to do is create a table using the unique colors and animals as row & column headers. Eventually I would like to have the table filled with the number for each combination (tried countifs, but was curious about using vlookup). I'm lost, because this seems so simple, yet I think I keep convoluting it...
Code:
[TABLE="width: 621"]
<tbody>[TR]
[TD]Colors[/TD]
[TD]Animals[/TD]
[TD][/TD]
[TD][/TD]
[TD]Red[/TD]
[TD]Orange[/TD]
[TD]Yellow[/TD]
[TD]Green[/TD]
[TD]Blue[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD]Dog[/TD]
[TD][/TD]
[TD]Bird[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Green[/TD]
[TD]Dog[/TD]
[TD][/TD]
[TD]Cat[/TD]
[TD]2[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Red[/TD]
[TD]Cat[/TD]
[TD][/TD]
[TD]Dog[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Blue[/TD]
[TD]Fish[/TD]
[TD][/TD]
[TD]Frog[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Blue[/TD]
[TD]Fish[/TD]
[TD][/TD]
[TD]Fish[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Red[/TD]
[TD]Dog[/TD]
[TD][/TD]
[TD][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