Populate a Variable size range with changing constants

olbucky

New Member
Joined
Jan 4, 2016
Messages
22
Below is an excerpt from a workbook I am attempting to build. I have been trying to automate the population of the correct range of rows in column F based on data input into columns B, C and D. The data in this example is manually entered to demonstrate my desired results.

Knowing each row will always be in 15 minute increments, with cell F7 selected, I would like to populate the correct number of rows including and below F7 with the T. Basal units based on the T. Basal % change (column C) multiplied by the Basal interval units (column B). Specifically, in this example, reduce 0.05 by 50% in 8 total rows (2 hours divided by 15 minute increments), rows 7 through 14.

Knowing the starting cell will change within column F and the inputs in columns B, C and D will also change, I would ideally like the code to look to the inputs, adjust the value and cell range appropriately and enter the values. I have tried multiple times and my minimal knowledge of VBA has only led to frustrating failure (Waa, waa, waa!). Any help is greatly appreciated. Even just a start.

Thanks,
Harry

ABCDEFG
1Date and TimeBasalT. BasalT. Basal TimeT. Basal TimeT. BasalBasal Net
2mm/dd/yy hh:mm AM/PMinterval units insulin% changehoursdaysunits Insulinunits Insulin
307/87/2018 9:45 AM0.05000.05
407/87/2018 10:00 AM0.05000.05
507/87/2018 10:15 AM0.05000.05
607/87/2018 10:30 AM0.05000.05
707/87/2018 10:45 AM0.0500-50%20.0833333330.02500.025
807/87/2018 11:00 AM0.05000.02500.025
907/87/2018 11:15 AM0.05000.02500.025
1007/87/2018 11:30 AM0.05000.02500.025
1107/87/2018 11:45 AM0.05000.02500.025
1207/87/2018 12:00 PM0.05000.02500.025
1307/87/2018 12:15 PM0.05000.02500.025
1407/87/2018 12:30 PM0.05000.02500.025
1507/87/2018 12:45 PM0.05000.05
1607/87/2018 1:00 PM0.05000.05
1707/87/2018 1:15 PM0.05000.05

<tbody>
</tbody>
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi olbucky,

First a “changing constant” is called a variable. Logically there is no such thing as a changing constant ;)

Second What does 87 mean in the mm/did/yyyy format? Is that a typo, or?!

Third it is hard to see what you are trying to do. Is it that when you have an entry in Column C that you need the values in Columns D through F?

If that is the case, try something like: =IF(TheValueInC is something other than an empty cell, Display the values you wed in the Columns D through F, “”)

You can test the length of the entry in C, or use IsNotBlank, or some other condition.

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,200
Members
449,072
Latest member
DW Draft

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