Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok gurus:
Can someone pleeeeaase shed some light on this for me... I have been asked to create a form in which the user is asked to select an appropriate General Ledger (GL) account code [via a list box], based on the nature of the expense they are processing. Only issue is that there are several legal entities (companies) within the organisation, each with their own set of [different] GL account codes (nothing is ever simple around here!) So I'm hoping to create a macro(?) where when a particular company is selected (via a validation list), the input range within the properties of the list box change to reflect the location of the corresponding codes; the user then makes their selection and the value is returned to the relevant cell. EG: User selects: Company 1 Account Classification List Box diplays set of GL Codes for Company 1... User selects: Company 2 Account Classification List Box then diplays set of GL Codes for Company 2 and so on.. there may be an even simpler way to do this?? Really appreciate any guidance here.. Many thanks in advance Sue :¬) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sue,
You may find this helpful http://www.contextures.com/xlDataVal02.html#Dynamic Cecil "Sue" wrote in message m... Ok gurus: Can someone pleeeeaase shed some light on this for me... I have been asked to create a form in which the user is asked to select an appropriate General Ledger (GL) account code [via a list box], based on the nature of the expense they are processing. Only issue is that there are several legal entities (companies) within the organisation, each with their own set of [different] GL account codes (nothing is ever simple around here!) So I'm hoping to create a macro(?) where when a particular company is selected (via a validation list), the input range within the properties of the list box change to reflect the location of the corresponding codes; the user then makes their selection and the value is returned to the relevant cell. EG: User selects: Company 1 Account Classification List Box diplays set of GL Codes for Company 1... User selects: Company 2 Account Classification List Box then diplays set of GL Codes for Company 2 and so on.. there may be an even simpler way to do this?? Really appreciate any guidance here.. Many thanks in advance Sue :¬) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there
Thanks for your response...the example you forwarded is heading in the right direction, although the resulting selection is then made via another validation list as opposed to a dialog/list box, which is what we're using. This is what I currently have down for the dialog box itself.: _________________________ 'SHOW DIALOG1 ACC Classification Code Sub showDialog1() If ActiveCell.Column = 4 Then If ActiveCell.Row < 33 Or ActiveCell.Row 44 Then resp = MsgBox("Please select the relevant cell in the 'AC Classification Code' column first.", vbError, "Active Cell Error") Else ' DialogSheets("ACCCode").ListBoxes("List box 1").ListIndex = 1 resp = DialogSheets("ACCCode").Show End If Else resp = MsgBox("Please select the relevant cell in the 'AC Classification Code' column first.", vbError, "Active Cell Error") End If End Sub Sub DialogOK1() ListIndex = DialogSheets("ACCCode").ListBoxes("List box 4").ListIndex mytext = DialogSheets("ACCCode").ListBoxes("List box 4").List(ListIndex) ActiveCell.FormulaR1C1 = Trim(Mid$(mytext, 1, 16)) End Sub ______________________________ At present the information within the list contains both the GL Code and a description of the code, eg: 5100000000006459 Consultancy Costs However the formula within the macro trims the information so that only the GL code is returned. The description is required to allow someone who is unfamiliar with the code (ie: most staff) to make a more accurate selection. What I need to do is make the list change based on the selection made within the target cell.. I think it starts something list this.. _______________________________ Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 17 And Target.Column = 6 Then Select Case Target.Value [This is where it gets messy - what I want it to do is: If Case = "TECHNOLOGY" then change source to range "'Sheet1!A:A")]??? Not sure what comes next.. Hope this makes sense.. Cheers again Sue "Cecilkumara Fernando" <cekufdo@sltnetDOTlk wrote in message ... Sue, You may find this helpful http://www.contextures.com/xlDataVal02.html#Dynamic Cecil "Sue" wrote in message m... Ok gurus: Can someone pleeeeaase shed some light on this for me... I have been asked to create a form in which the user is asked to select an appropriate General Ledger (GL) account code [via a list box], based on the nature of the expense they are processing. Only issue is that there are several legal entities (companies) within the organisation, each with their own set of [different] GL account codes (nothing is ever simple around here!) So I'm hoping to create a macro(?) where when a particular company is selected (via a validation list), the input range within the properties of the list box change to reflect the location of the corresponding codes; the user then makes their selection and the value is returned to the relevant cell. EG: User selects: Company 1 Account Classification List Box diplays set of GL Codes for Company 1... User selects: Company 2 Account Classification List Box then diplays set of GL Codes for Company 2 and so on.. there may be an even simpler way to do this?? Really appreciate any guidance here.. Many thanks in advance Sue :¬) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
List box change values based on selection | Excel Discussion (Misc queries) | |||
run macro with input msg based on cell input | Excel Discussion (Misc queries) | |||
How do I change the format of a cell based on what I input? | Excel Worksheet Functions | |||
limit cell list selection based on the selection of another list | Excel Worksheet Functions | |||
Macro to input formula in range based on another range | Excel Programming |