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

[TABLE="width: 598"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Date and Time[/TD]
[TD]Basal[/TD]
[TD]T. Basal[/TD]
[TD]T. Basal Time[/TD]
[TD]T. Basal Time[/TD]
[TD]T. Basal[/TD]
[TD]Basal Net[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]mm/dd/yy hh:mm AM/PM[/TD]
[TD]interval units insulin[/TD]
[TD]% change[/TD]
[TD]hours[/TD]
[TD]days[/TD]
[TD]units Insulin[/TD]
[TD]units Insulin[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]07/87/2018 9:45 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.05[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]07/87/2018 10:00 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.05[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]07/87/2018 10:15 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.05[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]07/87/2018 10:30 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.05[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD="align: right"]07/87/2018 10:45 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD="align: right"]-50%[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0.083333333[/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]07/87/2018 11:00 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]07/87/2018 11:15 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]07/87/2018 11:30 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD="align: right"]07/87/2018 11:45 AM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]07/87/2018 12:00 PM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD="align: right"]07/87/2018 12:15 PM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]07/87/2018 12:30 PM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.0250[/TD]
[TD="align: right"]0.025[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]07/87/2018 12:45 PM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.05[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD="align: right"]07/87/2018 1:00 PM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.05[/TD]
[/TR]
[TR]
[TD="align: right"]17[/TD]
[TD="align: right"]07/87/2018 1:15 PM[/TD]
[TD="align: right"]0.0500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.05[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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