I have an excel workbook that I have made a userform for. My plan for this form is to have the user pick a location from the first combo box and pick another location from the second combo box. After picking these two locations the user will click the run button to run the macro.
Example of Sheet1 data going down will grow, but width of table will not go past column F.
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Miami, FL[/TD]
[TD]Oakland, CA[/TD]
[TD]New York, NY[/TD]
[TD]Chicago, IL[/TD]
[/TR]
[TR]
[TD]TMS[/TD]
[TD]Nashville, TN[/TD]
[TD]$100[/TD]
[TD]$200[/TD]
[TD]$300[/TD]
[TD]$100[/TD]
[/TR]
[TR]
[TD]ATS[/TD]
[TD]Memphis, TN[/TD]
[TD]$200[/TD]
[TD]$300[/TD]
[TD]$100[/TD]
[TD]$150[/TD]
[/TR]
[TR]
[TD]NT[/TD]
[TD]Fresno, CA[/TD]
[TD]$70[/TD]
[TD]$120[/TD]
[TD]$152[/TD]
[TD]$170[/TD]
[/TR]
[TR]
[TD]NT[/TD]
[TD]Memphis, TN[/TD]
[TD]$50[/TD]
[TD]$70[/TD]
[TD]$100[/TD]
[TD]$150[/TD]
[/TR]
[TR]
[TD]ATS[/TD]
[TD]Nashville, TN[/TD]
[TD]$100[/TD]
[TD]$150[/TD]
[TD]$80[/TD]
[TD]$90[/TD]
[/TR]
[TR]
[TD]TMS[/TD]
[TD]Fresno, CA[/TD]
[TD]$200[/TD]
[TD]$70[/TD]
[TD]$300[/TD]
[TD]$250[/TD]
[/TR]
</tbody>[/TABLE]
So the first combo box, the user will chose either Miami, FL Oakland, CA New York, NY or Chicago IL
Second combo box, the user will choose from the other locations(Nashville, Memphis, Fresno)
So user chooses Miami, FL and Fresno, CA and clicks start.
The macro will then search Sheet1 and find all the results for Miami, FL and Fresno, CA and will make a new sheet and return the results for all matching the two locations.
Result Example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]COLUMN A[/TD]
[TD]COLUMN B[/TD]
[TD]COLUMN C[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Miami, FL[/TD]
[/TR]
[TR]
[TD]NT[/TD]
[TD]Fresno, CA[/TD]
[TD]$70[/TD]
[/TR]
[TR]
[TD]TMS[/TD]
[TD]Fresno, CA[/TD]
[TD]$200[/TD]
[/TR]
</tbody>[/TABLE]
Example of Sheet1 data going down will grow, but width of table will not go past column F.
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Miami, FL[/TD]
[TD]Oakland, CA[/TD]
[TD]New York, NY[/TD]
[TD]Chicago, IL[/TD]
[/TR]
[TR]
[TD]TMS[/TD]
[TD]Nashville, TN[/TD]
[TD]$100[/TD]
[TD]$200[/TD]
[TD]$300[/TD]
[TD]$100[/TD]
[/TR]
[TR]
[TD]ATS[/TD]
[TD]Memphis, TN[/TD]
[TD]$200[/TD]
[TD]$300[/TD]
[TD]$100[/TD]
[TD]$150[/TD]
[/TR]
[TR]
[TD]NT[/TD]
[TD]Fresno, CA[/TD]
[TD]$70[/TD]
[TD]$120[/TD]
[TD]$152[/TD]
[TD]$170[/TD]
[/TR]
[TR]
[TD]NT[/TD]
[TD]Memphis, TN[/TD]
[TD]$50[/TD]
[TD]$70[/TD]
[TD]$100[/TD]
[TD]$150[/TD]
[/TR]
[TR]
[TD]ATS[/TD]
[TD]Nashville, TN[/TD]
[TD]$100[/TD]
[TD]$150[/TD]
[TD]$80[/TD]
[TD]$90[/TD]
[/TR]
[TR]
[TD]TMS[/TD]
[TD]Fresno, CA[/TD]
[TD]$200[/TD]
[TD]$70[/TD]
[TD]$300[/TD]
[TD]$250[/TD]
[/TR]
</tbody>[/TABLE]
So the first combo box, the user will chose either Miami, FL Oakland, CA New York, NY or Chicago IL
Second combo box, the user will choose from the other locations(Nashville, Memphis, Fresno)
So user chooses Miami, FL and Fresno, CA and clicks start.
The macro will then search Sheet1 and find all the results for Miami, FL and Fresno, CA and will make a new sheet and return the results for all matching the two locations.
Result Example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]COLUMN A[/TD]
[TD]COLUMN B[/TD]
[TD]COLUMN C[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Miami, FL[/TD]
[/TR]
[TR]
[TD]NT[/TD]
[TD]Fresno, CA[/TD]
[TD]$70[/TD]
[/TR]
[TR]
[TD]TMS[/TD]
[TD]Fresno, CA[/TD]
[TD]$200[/TD]
[/TR]
</tbody>[/TABLE]