Totalling Selectable Column through User Interface

gu53xex

New Member
Joined
Mar 2, 2011
Messages
2
Hi,

I am a complete beginner to excel VBA and macros.

I have an excel spreadsheet which I want to use like a daily meal planner based on nutritional requirements. The first column is the names of nutrients found in food such as calcium, vitamin A, protein, etc. Each following column's first row has the name of a food; then each column continues down with values for the nutrients listed in the first column per 100 grams of that food. The data is all taken from here: http://www.nal.usda.gov/fnic/foodcomp/search/. The last column contains the values required for someone of my age, weight, and activity. This data is taken from: http://fnic.nal.usda.gov/interactiveDRI/.

I'm finding it a real pain to regularly select foods from this sheet, paste them into a new sheet, adjust the amounts by pasting special (e.g. dividing by 2 to get 50 grams, etc.), and use the sum function to total if I've fallen within the required range with my daily diet, so...

I'd like to create a more me-friendly meal planning program. I think my original vision of what I'd like to create is probably very complex, so I can start by asking how to do some first most basic steps:

1. I want to create an interface that allows me to select columns based on the name of the food in the first row of the column. So I'm given a list of the foods and I check them off, for example.

2. Because I don't eat 100 gram portions of everything I want to be able to adjust gram amounts of the selected foods. So there's some kind of box where I enter the amount.

3. Then I want to total the selected columns in the amounts of just chosen and see the total nutrients obtained so far. So, a window would pop up showing a column of nutrient totals based on consumed food items next to a column showing the acceptable ranges for my age, weight, activity.

4. Then I could continue to add or subtract foods and adjust amounts until I found some good combinations to meet the daily nutritional requirements.

That is the simplified version! But only if I could get that far would I even think of going further. This alone would be an achievement to save me a lot of annoying copying, pasting and summing!

I would be much appreciative if anyone could help me out on this one!

Thanks,

Gu
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi Andrew,

Thank you for the almost immediate response! :biggrin:

This looks really great! I am going to download it and test it out and learn about how it was made.

The only apparent problem at the moment is that this only totals up calorie amounts. For my health situation it is more important to track all nutrients and avoid deficiencies than to track calories.

I'll check this out, but in the meantime if you or anyone else has any more hints or suggestions to steer me in the right direction, that would be great!

Thanks again,

Gu
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

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