JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I have various tables of data (the number of columns and rows are always equal 6 x 368)
I'd like to design a "front" sheet where I can select different tables to retrieve and compare (i.e. average between values etc)
So far, I have a single drop down list and a macro that compares the value in the cell linked to the list and retrieves the related table. Code for this is:
Can people suggest ideas of how I can go about designing retriving two tables? One idea is two drop-down lists but I'd like the second list to be dynamic, i.e. not include the value from the first drop down list once selected
In addition, the number of tables is likely to increase in the future, so how can I make the code and the workbook layout to accomodate this, I'd rather not keep defining named ranges for each different table as I currently am.
If anyone wants to work on this with me, please PM for more details. I don't think it's particularly difficult as it's just data retrieval, but what I'm struggling with is an unknown number of final tables that would need to be included in the drop down lists (so those lists would need to be dynamic too) and then how to make the code adaptable for this.
Thank you in advance for any helps/thoughts/considerations,
Jack
I have various tables of data (the number of columns and rows are always equal 6 x 368)
I'd like to design a "front" sheet where I can select different tables to retrieve and compare (i.e. average between values etc)
So far, I have a single drop down list and a macro that compares the value in the cell linked to the list and retrieves the related table. Code for this is:
Code:
Sub ExtractSingleProduct()
Dim i As Long
Application.ScreenUpdating = False
Select Case Range("SingleListChoice")
Case 1
Range("GO_Swap").Copy
With Range("SingleListChoice").Offset(0, 2)
.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
.PasteSpecial Paste:=xlPasteFormats
End With
Case 2
Range("BS_Swap").Copy
With Range("SingleListChoice").Offset(0, 2)
.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
.PasteSpecial Paste:=xlPasteFormats
End With
Case 3
Range("FO_Swap").Copy
With Range("SingleListChoice").Offset(0, 2)
.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
.PasteSpecial Paste:=xlPasteFormats
End With
Case Else
i = Range("D" & Rows.Count).End(xlUp).Row
With Range("D9:I" & i)
.ClearContents
.ClearFormats
End With
End Select
Range("E:E").NumberFormat = "dd/mm/yyyy"
With Cells
.Font.Size = 8
.Columns.AutoFit
End With
Range("A1").Select
Application.ScreenUpdating = True
End Sub
In addition, the number of tables is likely to increase in the future, so how can I make the code and the workbook layout to accomodate this, I'd rather not keep defining named ranges for each different table as I currently am.
If anyone wants to work on this with me, please PM for more details. I don't think it's particularly difficult as it's just data retrieval, but what I'm struggling with is an unknown number of final tables that would need to be included in the drop down lists (so those lists would need to be dynamic too) and then how to make the code adaptable for this.
Thank you in advance for any helps/thoughts/considerations,
Jack