VBA buttons for fill a Table.

ForceofWill

New Member
Joined
Dec 3, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Enviar al foro.xlsm
ABCDEFGHIJKL
47C1C2C3C4
481
492
503
51
52C1C2C3C4C5C6C7C8
531dogcatbirdfishdog+cat+bird+fish+
542tomatocarrotcornpotato
553applepeargrapeorangeapple+
Prueba para post


I'm new to excel. I'm just learning how use formulas and also learning how use VBA. Thanks to this forum i learned a few things, but I'm still lack of some basics. I'm not an english speaker so i will try my best to expose what i want to do. What i want to do is Buttons for the second table. For example, a button for dog. When I click dog, it need to check the first table in the row 1, c1 (in this case E48) and if the is nothing in there put the value 1. If that row have a value, check if the c2 (F48) have a value , if not put 1. Keep doing that until row 1, c4 (H48). If i click the button cat, is will check the table 1, in the same row as dog, but instead of change the value to 1, it will change it for 2.

For example if I click, dog, cat cat dog the table 1 will look like this

Enviar al foro.xlsm
DEFGH
47C1C2C3C4
4811221
492
503
Prueba para post


This also happens with other combinations with table 2. But if the buttom is in row 2 of table 2, need to check for the row 2 in table 1.
Example: if i click this in order Corn, potato, tomato, carrot it should show

Enviar al foro.xlsm
DEFGHI
47C1C2C3C4
481
4923412
503
Prueba para post


So if i click for example this other, apple, orange, apple+, tomato, carrot, fish, fish, the table should look like this

Enviar al foro.xlsm
ABCDEFGHIJKL
47C1C2C3C4
48144
49212
503145
51
52C1C2C3C4C5C6C7C8
531dogcatbirdfishdog+cat+bird+fish+
542tomatocarrotcornpotato
553applepeargrapeorangeapple+
Prueba para post


Also, don't want to be the cells, for example E48 (is row 1, c1 in the table one) be selected by E48. Want it to be select for his position compared with the position of table 2. For example for dog, E48 is a -5 row - 1 column. So when I check if cell is empty, it should check by his position, instead of the value E48 (this is because if i insert cells above, I will need to fix all the vba codes again). I Think i Only need, help of how make one or two macros for the buttons, and i will fill the others manually based on the answer.
 
Last edited by a moderator:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Don't know if this question is complicated or if i expressed myself poorly. Any feedback?
 
Upvote 0
Hi there. I understand what you're trying to accomplish. I don't understand why you're trying to do this. If you're able to explain the reasoning behind the project, that might help a bit.

I recommend moving this project to it's own Worksheet to simplify the solution.

If you decide to move the project to another Worksheet, you could look into the Worksheet.SelectionChange event rather than placing buttons on the Worksheet. Or look into using a UserForm.

Let us know what you've tried and where you get stuck.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top