+ Reply to Thread
Results 1 to 21 of 21

Depending dropbox

  1. #1
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82

    Depending dropbox

    Hi

    I need to make a Dropbox who populate values depending other Dropbox. For example at the example file I have two sheets, one for the values (Hoja2) and the other for the data (Hoja1). I want to limit the input data to the value list:

    - At column Country I define a dinamic range to populate a Dropbox with all the data at the column A at the value list. This I have

    - At column City I need that depending on the value I select at column Country shows at one Dropbox all the values at the row of this country I have at values sheets. This values can change, adding or remove values. Is there any posibility to do this with formula and without using range name? I'm think on Offset or Vlook formula but I can't figure out how to use.

    At the example If I select EEUU at the column City I nedd it apears at the combo in City column all the values I may have at the row 3 (excluding column A), and set it dinamically (I can delete or add values at the row).

    Thanks in advance for any help
    Attached Files Attached Files
    Last edited by Judith_Chao; 02-01-2017 at 01:29 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Depending dropbox

    See if you can adapt the attached to your needs.

    It used named ranges for each level and sub-levels
    It used INDIRECT() to pull in the sub-levels

    let me know how you make out please
    Attached Files Attached Files
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82

    Re: Depending dropbox

    Quote Originally Posted by FDibbins View Post
    See if you can adapt the attached to your needs.

    It used named ranges for each level and sub-levels
    It used INDIRECT() to pull in the sub-levels

    let me know how you make out please
    Thank you for the answer but, it's posible to do the same without using range name, i don't know with vlook formula or similar?.

    Also the range names are not dinamics, I need the adapt to the data I put, and change automatically if i added some value or remove it. If i'm correct the range names defined at your file are static, you must change ir manually if changes the values.

    Any way, many thanks for the answer.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Depending dropbox

    In order to use the cell contents of 1 DD to ID the contents for the next DD, you need to use INDIRECT - it's the only (formula) way to use text as a reference in a formula.
    You also need to use named ranges, to ID the range/contents that you need to access

    To make the ranges dynamic is not that much of an issue.

    Go to: Insert>Name>Define and in the Names in workbook box type any one word name (I will use MyRange) the only part that will change is the formula we place in the Refers to box.
    If you are using numerics...
    In the Refers to box type: =OFFSET($A$1,0,0,COUNT($A:$A),1)

    for text/numeric...
    In the Refers to box type: =OFFSET($A$1,0,0,COUNTA($A:$A),1)

    There are a few others but that should help

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Depending dropbox

    Deleted my duplicate post

  6. #6
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82

    Re: Depending dropbox

    My problem is if I use offset at the first drop (I.e. Country column) it gives me erro le if I try to use indirect at the City Dropbox even the range name was correct. If I use static ranges gives me no problem but with dynamics it give me error.

    For that I ask to make this without range names in order to be able to define ranges dinamically

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,673

    Re: Depending dropbox

    See here ...


    http://www.contextures.com/xlDataVal02.html#Dynamic

    Attached has an example using your data.

    Create named ranges for titles in B1:E1 i.e EEUU, Spain, France, Deutschland

    Then select each column e.g. column B and call it "EEUUCol" etc

    in Sheet 1 B5

    DV

    =List

    refers to: =OFFSET(INDIRECT($A5),1,0,COUNTA(INDIRECT($A$5&"Col")),1)
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82
    Quote Originally Posted by JohnTopley View Post
    See here ...


    http://www.contextures.com/xlDataVal02.html#Dynamic

    Attached has an example using your data.

    Create named ranges for titles in B1:E1 i.e EEUU, Spain, France, Deutschland

    Then select each column e.g. column B and call it "EEUUCol" etc

    in Sheet 1 B5

    DV

    =List

    refers to: =OFFSET(INDIRECT($A5),1,0,COUNTA(INDIRECT($A$5&"Col")),1)
    I see it and it works tank you .... But I prefer one option without names.

    Only for knowing is possible to do that withou name ranges, I don't know if using vlook or index can substitute the name range ... is this possible ? I have spaces and signs at the names and I can not use them at name range so I need another method


    Many thanks for your answer
    Last edited by Judith_Chao; 02-02-2017 at 05:48 AM.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,673

    Re: Depending dropbox

    This is the only way to do it.

    What is your objection to named ranges?

  10. #10
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82
    Quote Originally Posted by JohnTopley View Post
    This is the only way to do it.

    What is your objection to named ranges?
    That I have names with espaces and signs that I cannot use reference. Example, I may have a range "Axa security's" and I need to appear like that at the first column and then select some of their policy's at the second combo. I can't create a range name "axa security's".

    I have a userform to search the data and no problem with vba I made a depending combos in order to filter the data. But now I want to use data validation at the sheet I have the database so I use drops but with range names I must change half of my list of values because they had spaces and other signs .... maybe I can use the same code from the userform at the drop at the sheet but I don't know how...
    Last edited by Judith_Chao; 02-02-2017 at 06:03 AM.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,673

    Re: Depending dropbox

    You can get round the spaces and other characters::

    "Axa_security" is automatically generated As a named range if you have a heading of "Axa security" remove the apostrophe and "S"

    With A1= "Axa Security"

    then you can use =INDIRECT(SUBSTITUTE(A1," ","_"))

    which replaces the blanks in A1 drop down with"_" to match named ranges.
    Last edited by JohnTopley; 02-02-2017 at 08:34 AM.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,673

    Re: Depending dropbox

    See example of "United Kingdom" in Drop down

    Post a sample of your data with "special" characters.
    Attached Files Attached Files
    Last edited by JohnTopley; 02-02-2017 at 08:36 AM.

  13. #13
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82

    Re: Depending dropbox

    Thank you

    I check when I arrive home ... Only for confirm, the column I must use to name the ranges it can appear the symbols - / . and blank spaces. I hope Your file solve all of it ....
    Last edited by Judith_Chao; 02-02-2017 at 01:19 PM.

  14. #14
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82

    Re: Depending dropbox

    Thank you

    I check when I arrive home ... Only for confirm, the column I must use to name the ranges it can appear the signs : - / . And blank spaces. I hope Your file solve all of it ....

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,673

    Re: Depending dropbox

    As I requested earlier. post a sample of your data with "special" characters.

    Example:

    A1: abc-gfh / 123.xyz

    Using =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"/","_")," ","_"),"-","_"),".","_") we get

    abc_gfh___123_xyz

    Using =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"/","_")," ","_"),"-","_") we get

    abc_gfh___123.xyz

    Both the highlighted are valid named ranges

    You could put the SUBSTITUTION formulae in a "helper" cell and reference the "helper" cell with INDIRECT.

    OR

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"/","")," ",""),"-","_")

    to give

    abc_gfh123.xyz
    Last edited by JohnTopley; 02-02-2017 at 01:51 PM.

  16. #16
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82
    Quote Originally Posted by JohnTopley View Post
    As I requested earlier. post a sample of your data with "special" characters.
    Sorry I was at work with the phone so I can't attach any file... examples of the special characters are:
    Generally secure - AGM
    M.N.G Absolute
    Axa Security / M. N. G.

    This is a resume of the possibilities you can find ... into 4 hours I arrive home and I can upload a file. Sorry for the example of countries it was the easy way to create a test file early this morning in the rush. The data I must use are name of secure companies and his different policys so I can have more or less anything of name. Is for that I prefer not use names and use or similar formula (or even the same code I use for the combo is at the user form I created to search the data and who admits all the values)...

    Thanks for you replay, if you need an example file I uploaded it when arrive home

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Depending dropbox

    Is this what you're trying to do?
    Attached Files Attached Files
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,673

    Re: Depending dropbox

    See Tony's method of using OFFSET which removes the need for named ranges: only requirement is data must be sorted ("countries" grouped together) but I don't think that is a major issue.
    Last edited by JohnTopley; 02-02-2017 at 02:16 PM.

  19. #19
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82

    Re: Depending dropbox

    Quote Originally Posted by JohnTopley View Post
    See Tony's method of using OFFSET which removes the need for named ranges: only requirement is data must be sorted ("countries" grouped together) but I don't think that is a major issue.
    Now I created a test file more exactly than the other. At Mutuas Sheet you can see an example about haw I speak. I make the first column List with code, it rest only makes the depending one, second one. I have a code at sheet data to fill the columna A and C from sheet data with a dynamic list (from values of column A from Pruebas and Mutuas). It rest make it for column B and D from the shett whic values depends at first column as you can see at the sheet pruebas and Mutuas (the rows values dependes of the values selected at first column).

    I hope you can provide me any guide with fornula (vlook, Index, Match, etc.) that you don't need to use names. At the user form I have been able to do without problem....

    Also I check and I can't use Ofset range at column B or D if I use Indirect to get colum A or C values. I only can use static ranges with indirect formula
    Attached Files Attached Files
    Last edited by Judith_Chao; 02-03-2017 at 03:13 AM.

  20. #20
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,673

    Re: Depending dropbox

    See "Data (2)" columns C & D

    DV in D

    =OFFSET(List!$H$1,MATCH($C7,List!G:G,0)-1,,COUNTIF(List!G:G,$C7))

    Data for DV is in columns G and H in "List"
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    01-08-2017
    Location
    Barcelona
    MS-Off Ver
    Office 2019
    Posts
    82
    Quote Originally Posted by JohnTopley View Post
    See "Data (2)" columns C & D

    DV in D

    =OFFSET(List!$H$1,MATCH($C7,List!G:G,0)-1,,COUNTIF(List!G:G,$C7))

    Data for DV is in columns G and H in "List"
    Thank you ... I see at you example I must make another table to use the formula you give me. One question, the table must be ordered?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Populating dropbox depending on the value of another dropbox
    By megabolic in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-01-2017, 03:37 AM
  2. Addin in dropbox
    By robato in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2016, 10:11 AM
  3. VBA Dropbox links
    By PetiteMorte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-27-2015, 10:00 AM
  4. need to add another value in the dropbox
    By rolosa in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-30-2014, 12:09 PM
  5. need to add another value in the dropbox
    By rolosa in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-30-2014, 10:49 AM
  6. Excel VBA Code to upload a file to Dropbox using the Dropbox API
    By gb# in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2014, 03:41 PM
  7. DropBox Calulation
    By brandnicks in forum Excel General
    Replies: 2
    Last Post: 12-02-2011, 09:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1