Hello Excel Gurus,
This is a question on Limit Selection List which is taken from something that I found on Contextures spreadsheet examples DV0023. I am using Excel 2007 on Windows 7. In the example, it uses an advanced filter to create a short list using Event code. The event code uses a character that is entered into cell B3 (Name) on the "Summary" sheet and then looks up all the names starting with that letter from the sheet "Sales Data". When I look at the code that runs, it only checks data in Cell B3. I want to know if it's possible to have this dynamically change based on which row you are in ie if you have a formula you can copy it down so that instead of referring to say B3, it's B4 or B5 or B6 - whichever row you are in. It is possible to change the code to be active sheet & current cell lookup and place the option list in the cell to the right?
The example workbook is available from http://www.contextures.com/excelfiles.html and search for DV0023.
Thank you in advance,
Regards Tom
This is a question on Limit Selection List which is taken from something that I found on Contextures spreadsheet examples DV0023. I am using Excel 2007 on Windows 7. In the example, it uses an advanced filter to create a short list using Event code. The event code uses a character that is entered into cell B3 (Name) on the "Summary" sheet and then looks up all the names starting with that letter from the sheet "Sales Data". When I look at the code that runs, it only checks data in Cell B3. I want to know if it's possible to have this dynamically change based on which row you are in ie if you have a formula you can copy it down so that instead of referring to say B3, it's B4 or B5 or B6 - whichever row you are in. It is possible to change the code to be active sheet & current cell lookup and place the option list in the cell to the right?
The example workbook is available from http://www.contextures.com/excelfiles.html and search for DV0023.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim wsSD As Worksheet
Dim wsS As Worksheet
Set wsSD = Sheets("Sales Data")
Set wsS = Sheets("Summary")
If Target.Address = "$B$3" Then
wsS.Range("C3").Value = ""
wsSD.Range("Database").AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=wsS.Range("B2:B3"), _
CopyToRange:=wsSD.Range("J1"), Unique:=True
End If
End Sub
Thank you in advance,
Regards Tom