Insert custom text in a cell

mlogozar

New Member
Joined
Apr 18, 2020
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
I am creating micronutrient calculator that will do the following: you enter that today, you ate 200g of broccoli. On the main chart, you will see how many vitamins and minerals you are from reaching the weekly goal for them from these 200 grams of broccoli.

I have the database of vitamins and minerals for 1 gram of vegetables. The main idea is that a user enters what did they eat every day from vegetables and they just enter the amounts - what they see is a chart, progress bar type, where they will be able to check did they managed to fill their weekly target for that vitamin or mineral from vegetables.

I had the idea of using vlookup and when someone enters, for example 200 grams of broccoli, vlookup will find it in the database and sum up the amounts for every vitamin and mineral and add it to the chart. What I am worried about is the most simple way for a user to enter those values.

One of the ideas was to provide them a sheet with vegetable names and they just have to enter the amounts next to the name and the chart is automatically refreshed. In the end of the week, I would program a button that would clear the selected cells and they could input it from the start. What worries me about that solution is that they will have like, sheet with 50 rows and they have to fill some of them + if today they eat 150 grams of broccoli and tomorrow 200 grams, they have to sum it up manually.

Then I came up with an idea to program a button that will have two fields: food name and food amount and when they type that, it will be written in a hidden sheet where we will just have vlookup connected with the database. When a users enter food name and food amount, that will be written in that field and chart will automatically refresh.

Do you have idea on how to write VBA code for this specific thing, inserting a custom text in a cell, starting from A2 and B2, and each next input is being written in the first row below.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Okay, sounds simple enough. Can you attach a copy of your workbook to a cloud location such as OneDrive or GitHub and provide a link to the file?
 
Upvote 0

Forum statistics

Threads
1,214,639
Messages
6,120,679
Members
448,977
Latest member
dbonilla0331

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