viniciuspgomes
New Member
- Joined
- Nov 9, 2010
- Messages
- 1
Hi all,
I have a problem and do not know how to solve.
I have the following sample worksheet:
<table width="192" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 48pt;" width="64">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
So I need to activate a macro that calls a userform and I ask the following question:
Do you want to create a primary category? Yes or No?
If yes, for example, I type cereal and it appears just below the other foods:
<table width="192" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 48pt;" width="64">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
If not, the macro asks to me what the name of the secondary category.
And I pick fruit in a radio button and then the macro asks me the name of the fruit. So I type strawberry. And the strawberry appears under the category of fruit. But the primary categories should be moved down.
<table width="199" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64"> <col style="width: 53pt;" width="71"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 53pt;" width="71">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>strawberry </td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
And the macro asks me if I want to add another category. Since I already have a primary and secondary category, macro now also ask me if I want to include a tertiary category.
Suppose I click yes. Then the macro asks me which of the subcategories I want to include a third category. I chose strawberry and typed "green."
So the categories should go down again.
<table width="199" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64"> <col style="width: 53pt;" width="71"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 53pt;" width="71">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>strawberry </td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>green</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
Then the macro will always ask me if I want to include a new category until I click no. And I must always use radio buttons for my choices.
See how you'd like to stay:
<table width="199" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64"> <col style="width: 53pt;" width="71"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 53pt;" width="71">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>strawberry </td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>green</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>red</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td class="xl24">apple</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td class="xl24">sweet</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">
</td> <td class="xl24">potato</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td class="xl24">kale</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>fresh</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
And so on...
And in the end I will create a Data Grouping for the first, second and third category from the menu data from excel.
It's urgent. Any help will be considered.
Thanks.
I have a problem and do not know how to solve.
I have the following sample worksheet:
<table width="192" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 48pt;" width="64">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
So I need to activate a macro that calls a userform and I ask the following question:
Do you want to create a primary category? Yes or No?
If yes, for example, I type cereal and it appears just below the other foods:
<table width="192" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 48pt;" width="64">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
If not, the macro asks to me what the name of the secondary category.
And I pick fruit in a radio button and then the macro asks me the name of the fruit. So I type strawberry. And the strawberry appears under the category of fruit. But the primary categories should be moved down.
<table width="199" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64"> <col style="width: 53pt;" width="71"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 53pt;" width="71">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>strawberry </td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
And the macro asks me if I want to add another category. Since I already have a primary and secondary category, macro now also ask me if I want to include a tertiary category.
Suppose I click yes. Then the macro asks me which of the subcategories I want to include a third category. I chose strawberry and typed "green."
So the categories should go down again.
<table width="199" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64"> <col style="width: 53pt;" width="71"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 53pt;" width="71">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>strawberry </td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>green</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
Then the macro will always ask me if I want to include a new category until I click no. And I must always use radio buttons for my choices.
See how you'd like to stay:
<table width="199" border="0" cellpadding="0" cellspacing="0"> <col style="width: 48pt;" width="64"> <col style="width: 53pt;" width="71"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">A</td> <td style="width: 53pt;" width="71">B</td> <td style="width: 48pt;" width="64">C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">fruit</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>strawberry </td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>green</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>red</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td class="xl24">apple</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td class="xl24">sweet</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vegetable</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">
</td> <td class="xl24">potato</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">greenery</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td class="xl24">kale</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">
</td> <td>
</td> <td>fresh</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">cereal</td> <td>
</td> <td>
</td> </tr> </tbody> </table>
And so on...
And in the end I will create a Data Grouping for the first, second and third category from the menu data from excel.
It's urgent. Any help will be considered.
Thanks.