Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this challenging assignment, you will create a VBA subroutine that will iterate through a set of files to bring in data from those files

In this challenging assignment, you will create a VBA subroutine that will iterate through a set of files to bring in data from those files into a central spreadsheet. In the Week 3 folder there is another folder Ralphie Reactor(with files representing the output of the "Ralphie Reactor" - named for the mascot here at CU Boulder!). Within this folder are 24.csv files, which are generated by a (hypothetical) bioreactor. You are in charge of quality assurance and wish for the temperature of the bioreactor to remain around 37\deg C, the pH to stay around 5.5, and the dissolved oxygen (dO2) concentration to remain around 50%. The Ralphie Reactor automatically outputs the temperature, pH, and dO2 concentration every hour, 24 hours a day, and places the data into an hourly summary file. For example, here is what one might look like, at 3:00 a.m.(in the RalphieReactor_10-22-17_300.csv file):
As head of quality assurance, it is your job to summarize and analyze the results (perhaps in graphical form) once a day. Therefore, you set up a central file in which every morning you can import and analyze the data in those 24 hourly summary files rather than doing this manually (copying/pasting from those 24 files each day).
You wish to automate the import of these 24 hourly summary files into a main file (the Assignment 3 STARTER.xlsm file). The data in cells B3:B6(column) in each hourly summary file should be placed row-wise into the Assignment 3 STARTER.xlsm file, as shown below:
*This is the result after the subroutine has been executed.
Please see the Assignment 3 screencast for a detailed demonstration of what you are trying to create in this assignment.
**HINT #1: To enable the user to input a range of cells using an input box, see the screencast "How to select a range using the input box method". You can adapt the code to enable the user in your subroutine to select cells B3:B6(as requested by the grading file) of the sheets that you import.**
**HINT #2: If you are following the method I used above in HINT #1 in the screencast referenced, UserRange is a range, and you need to convert that to a string in order to use later in your subroutine. You can use something like ImportRange = UserRange.Address, where ImportRange is Dim'med as a String. Later on, when you are iterating through your workbooks, you can refer to that range of each workbook by using Range(ImportRange)- be sure to use the full reference, e.g. aWB.Sheets(1).Range(ImportRange).Cells(,).
I have already placed three plots into this workbook, one each for temperature (column B), pH (column C), and dO2 concentration (column D). Therefore, this makes it easy each day to import the 24 files and quickly analyze the data for any problems. It is likely that the time scales will be converted to decimals (fraction of a day), but that's okay.
What you need to do is create a properly working file that imports the data in the 24 hourly summary files into your main file.
Helpful hint: To select multiple files in a folder, you can click on a file and hold down the Ctrl key while selecting additional files. Or, Shift-click will select all files within two files. Better yet, click on one file in a folder then Ctrl-a to select all files in that folder!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions