VBA to create a custom table

pyclen

Board Regular
Joined
Jan 17, 2022
Messages
85
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi All,

Before I provide a specific generalized example I would like to ask this great community whether it is possible to make a script in VBA that will ask the user for input, and then based on the input provided generate a table which will be used for a cost calculation on either the same or a different sheet.

Input required would include
Temperature/humidity, i.e. 25C/60%RH, there are usually 3 combinations
Length of time in months for each combo, and lastly what test is performed at each time and temperature/humidity combo

I am happy to provide a generic sample table
Any help is appreciated
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
below is an example of a table I want to generate

Condition 1, 2, 3 correspond to various temperature/humidity combinations (25C/60% RH for example)

T1 - T10 are various timepoints (in months) from T1 that samples get tested using Test 1, 2, 3, 4 (I am trying to be a general as possible here so people can get a better understanding)

Tests shown for condition 2 are optional, and only executed when either or both of the other conditions fails (this can be addressed in a separate table if necessary using the same input script)

This table then serves as source for the calculation of how much it cost to test at any given timepoint

What I would like in a VBA script is to ask users to
  1. define conditions 1, 2, 3 (one is optional, so could be in a separate inquiry) by either selecting them from a dropdown (not shown in example) or typing (25C/60% RH for example)
  2. define timepoints besides initial, either again manually typing or selcting them from a dropdown
  3. define what is tested at what condition and timepoint
  4. after the user inoput a table like shown below is generated
I know that is a big ask (maybe too big) but I hope someone can answer maybe something like that is feasible or not
Thank you


Book1
CDEFGHIJKLMN
2
3storage conditiontime [months]
4T1T2T3T4T5T6T7T8T9T10
5condition 1a,b,c,da,ba,ba,ba,ba,b,c,da,ba,b,c,da,b,c,da,b,c,d
6condition 2(a,b)(a,b)(a,b)(a,b)(a,b,c,d)
7condition 3a,ba,ba,b,c,d
8
9
10T1 --> T10T1 = initiala =Test 1
111b =Test 2
122c =Test 3
133d =Test 4
146
159
1612
1718
1824
1936
2048
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,639
Messages
6,125,967
Members
449,276
Latest member
surendra75

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