Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need help to create a Macro to fill a list box with names from
another sheet and then when the list box changes to activate another macro that will display some charts. So far I only have the following code: Range("B5").Select ActiveWorkbook.Names.Add Name:="EmployeeNames", RefersToR1C1:= _ "=Employees!R1C1:R230C1" ActiveWorkbook.Names.Add Name:="EmployeeNames", RefersToR1C1:= _ "=Employees!R1C1:R230C1" With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=EmployeeNames" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With I got it from using th emacro recorder. Now I am stuck Can someone please help me |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Jan 15, 5:59*pm, wrote:
I need help to create a Macro to fill a list box with names from another sheet and then when the list box changes to activate another macro that will display some charts. So far I only have the following code: Range("B5").Select ActiveWorkbook.Names.Add Name:="EmployeeNames", RefersToR1C1:= _ * * * * "=Employees!R1C1:R230C1" * * ActiveWorkbook.Names.Add Name:="EmployeeNames", RefersToR1C1:= _ * * * * "=Employees!R1C1:R230C1" * * With Selection.Validation * * * * .Delete * * * * .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ * * * * xlBetween, Formula1:="=EmployeeNames" * * * * .IgnoreBlank = True * * * * .InCellDropdown = True * * * * .InputTitle = "" * * * * .ErrorTitle = "" * * * * .InputMessage = "" * * * * .ErrorMessage = "" * * * * .ShowInput = True * * * * .ShowError = True * * End With I got it from using th emacro recorder. *Now I am stuck Can someone please help me OK, I found the answer. I didn't know the difference between a listbox and a validation list; I got them confused. the above code is for creating a validation list. Below is my code to run another macro upon selection change. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) ', With Sh If .Name = "Sheet5" Then If Target.Address = "$B$3" Then 'MsgBox Target.Value Run "test_listbox2" End If End If End With End Sub This was a bit trycking being that Workbook_SheetChange by default works on all sheets. Thank You |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Want to Create a List in Excel 2002; Don't see List in Data Menu? | Excel Discussion (Misc queries) | |||
base price list compute on to another price list? on excel work sh | Excel Discussion (Misc queries) | |||
multiple select from the drop down list in excel. list in one sheet and drop down in | Excel Discussion (Misc queries) | |||
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 | Excel Worksheet Functions | |||
Does Excel 2002 have a List>Create List option under Data? | Excel Discussion (Misc queries) |