+ Reply to Thread
Results 1 to 27 of 27

Connect values from sheets to a drop-down list

Hybrid View

hungry4more Connect values from sheets to... 11-27-2014, 03:54 AM
Glenn Kennedy Re: Connect values from... 11-27-2014, 03:59 AM
hungry4more Re: Connect values from... 11-27-2014, 03:28 PM
davesexcel Re: Connect values from... 11-27-2014, 04:03 AM
hungry4more Re: Connect values from... 11-27-2014, 04:35 AM
Glenn Kennedy Re: Connect values from... 11-27-2014, 03:34 PM
hungry4more Re: Connect values from... 11-27-2014, 03:50 PM
Glenn Kennedy Re: Connect values from... 11-27-2014, 03:53 PM
hungry4more Re: Connect values from... 11-27-2014, 03:55 PM
Glenn Kennedy Re: Connect values from... 11-27-2014, 04:27 PM
hungry4more Re: Connect values from... 11-27-2014, 04:59 PM
davesexcel Re: Connect values from... 11-30-2014, 08:50 AM
hungry4more Re: Connect values from... 11-30-2014, 01:57 PM
davesexcel Re: Connect values from... 11-27-2014, 05:17 PM
hungry4more Re: Connect values from... 11-28-2014, 06:27 AM
Glenn Kennedy Re: Connect values from... 11-27-2014, 06:43 PM
Glenn Kennedy Re: Connect values from... 11-28-2014, 04:26 AM
hungry4more Re: Connect values from... 11-28-2014, 06:33 AM
Glenn Kennedy Re: Connect values from... 11-28-2014, 06:37 AM
hungry4more Re: Connect values from... 11-28-2014, 07:21 AM
Glenn Kennedy Re: Connect values from... 11-28-2014, 07:32 AM
hungry4more Re: Connect values from... 11-28-2014, 03:05 PM
Glenn Kennedy Re: Connect values from... 11-28-2014, 03:44 PM
hungry4more Re: Connect values from... 11-28-2014, 07:13 PM
Glenn Kennedy Re: Connect values from... 11-29-2014, 06:17 AM
hungry4more Re: Connect values from... 11-29-2014, 07:39 AM
Glenn Kennedy Re: Connect values from... 11-30-2014, 02:14 PM
  1. #1
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Connect values from sheets to a drop-down list

    OK. You won't like this.... but.

    I have added a sheet, onto which the sheet names have to be added (I have allowed for 20 sheets, but the Named Range can be adjusted to add more, if needed). I've used Data Validation on cell A2 o your Value Sorter. I had to kill the merged cell (A2&B2) to get it to work. Merged cells are the work of Satan and are best avoided wherever & whenever possible.


    In cells C2 and right I have used the INDIRECT function to show you the problem. Cell E2 picks up the sheet name and combines it with E6 to correctly return 9,105,430. BUT. The syntax means that when you drag it to the right, the column letter does not update. To re-work your entire sheet would be a total nightmare.

    However, by the addition of another phrase into the formula, you can get the column letter to update. See Cell F3. A more complicated formula, but when you drag it to the right, the use of RIGHT, CELL, etc, makes the column letter update as you drag to the right. BUT.

    You cannot readily make something that copies DOWN as well. The rows that are being copied form the other sheets are not incrementing by 1 or 2 or 3. That would be something that could be addressed. However, in some places they increment by 1. In other cases it appears to be 22. There may be other variants.

    You have two choices, maybe more.

    1. Paste the formula in E3 into E22, E24, etc, adjusting the 6 at the end to reflect the target row. Then drag across.

    2. It should be quite easy to get the formula set to increment the row number by 1, as you paste down two rows at a time. That would cut out a lot of the manual adjustments needed. However, I can't do that tonight. I'll certainly take a look in the morning for you. Just let me know how you'd like to proceed.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  2. #2
    Registered User
    Join Date
    02-01-2014
    Location
    Sverige
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Connect values from sheets to a drop-down list

    thanks for the information. I was heading in the same direction but didn't know what function to use. Will read more about this INDIRECT function and how to use it.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Connect values from sheets to a drop-down list

    Here's some code that you can try out to edit the formulas, check out the attached example, when you click new formula, Column E formulas will change to the indirect formulas.
    Sub FigureItOut()
        Dim ws As Worksheet
        Dim r1 As Range, r2 As Range, s As String
        Dim x, p As String, fla As String
        Dim Rws As Long, Rng As Range, c As Range
    
        Set ws = Worksheets("Value genetrator")
        Set r1 = ws.Range("B:B")
        Set r2 = ws.Range("E:E")
        Application.ScreenUpdating = 0
        r1.AutoFilter Field:=1, Criteria1:="<>"
        r2.Replace What:="=Sheet", Replacement:="""", LookAt:=xlPart, _
                   SearchOrder:=xlByRows, MatchCase:=False
        ws.AutoFilterMode = 0
        r2.AutoFilter Field:=1, Criteria1:="=*""*", _
                      Operator:=xlAnd
    
        Rws = Cells(Rows.Count, "E").End(xlUp).Row
        Set Rng = Range(Cells(2, 5), Cells(Rws, 5))
        For Each c In Rng.SpecialCells(xlCellTypeVisible)
            x = InStr(c, "!")
            s = Mid(c, x + 1, Len(c))
            p = """=INDIRECT(""'""&A11&""'!""&"""
            fla = p & s & """)"
            c = fla
        Next c
        r2.Replace What:="""=", Replacement:="=", LookAt:=xlPart, SearchOrder _
                                                                  :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
        ws.AutoFilterMode = 0
    End Sub
    Can you not use this forums upload to attach pics instead of using a 3rd party uploader??
    Attached Files Attached Files
    Last edited by davesexcel; 11-30-2014 at 08:59 AM.

  4. #4
    Registered User
    Join Date
    02-01-2014
    Location
    Sverige
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Connect values from sheets to a drop-down list

    I got it to work now, just added one more condition for the state so now it has 4 conditions that are changed using the dropdown lists. When it comes to the variation i just switched from searching in the range E1 (rows) to searching between E-X in row 5. Now it searches for the intersection in the selected range varied by the dropdown lists . Will try out your function also "davesexcel", thanks for the help, the thread can close.

+ 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. Replies: 1
    Last Post: 05-14-2014, 12:52 AM
  2. [SOLVED] Drop Down List hyperlink to sheets in another workbook
    By imran91 in forum Excel General
    Replies: 9
    Last Post: 09-04-2012, 12:05 AM
  3. Drop down list, limiting to corresponding values of other list selection
    By Swash in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2010, 03:06 PM
  4. Replies: 12
    Last Post: 12-09-2009, 04:19 PM
  5. Making cell values correspond with Drop down List values
    By jrcream in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2008, 03:14 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