Set a range to an input box on a template. Then have another macro use that range.

dmenegr

New Member
Joined
Apr 20, 2013
Messages
7
Hello All,

We have about 2000!! files that are in a table in word format, that we use to record data in our high volume lab. As you can imagine this is cumbersome system. What I have recently purposed to a customer is a excel workbook to be used throught out the entire process, from data gathering to the back end when engineers are plotting data. I made up a sample that has a template data entry sheet, with a macro to duplicate itself. Then 2 summary sheets that sort and the data by process and each data set, and a statistics for each page with average, Standard deviations,UCL, LCL, etc. Then finally another sheet which tracks the data and sorts it by month. This took a while to do and I don't want to repeat this process 2000 more times.

So what I'm looking to do it have a excel template made up, that on start up imports a user generated sheet as the data entry sheet. Then go through data entry sheet and have a user define each data set as a range per an input box. Then use those defined ranges in another macro to populate summary sheets, without having to reselect the range?

Is this possible?

Code:
Sub Auto_Open()
If ActiveWorkbook.Name = "E-MCL Template" Then
Set ActiveWorkbook.Name = Application.MsgBox(Prompt:="Enter File Name as MCL-XXXXX", Title:="Rename File", Type:=8)
End If
If MsgBox("Enter MCL Data Table Here", vbYesNo, "Reset") = vbYes Then
Sheets("Template").Select
End Sub


Sub DefineData()
Dim Rng(0 To 20) As Range, DataSetname(0 To 20) As String
Set DataSetname(0) = Application.InputBox(Prompt:="Enter Heading of first Data Set", Title:="Data Set 1 Title", Type:=8)
Set Rng(0) = Application.InputBox(Prompt:="Enter Range of first Data Set", Title:="First Data set Range", Type:=8)
Set DataSetname(1) = Application.InputBox(Prompt:="Enter Heading of second Data Set", Title:="Data Set 2 Title", Type:=8)
Set Rng(1) = Application.InputBox(Prompt:="Enter Range of first Data Set", Title:="Second Data set Range", Type:=8)
' Etc.
End Sub


Sub ImportData()
' Have this macro use the Ranges defined in "DefineData" to populate a summary sheet.
End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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