Lists from second workbook

ryansm05

Board Regular
Joined
Sep 14, 2016
Messages
129
Hi,

I've created a drop-down list in my 'Summary' workbook based on the data in my 'Master' workbook - using a named range.

However, when this 'Master' is not open, the drop-down menu in the 'Summary' does not work.

Is there any way around this?

Thanks in advance
Ryan
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

ryansm05

Board Regular
Joined
Sep 14, 2016
Messages
129
Yes but unfortunately this requires both workbooks to be open.
This is the issue I'm trying to avoid?
Thanks
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,637
Office Version
365
Platform
Windows
Is there any way around this?
Copy the named range to the summary workbook?
 

ryansm05

Board Regular
Joined
Sep 14, 2016
Messages
129
When you say copy the named range can you elaborate a little?

The data needs to stay in the 'Master' workbook and will be updated weekly.
The 'Summary' sheet will be duplicated daily for specific jobs, so it's not possible to have this data in these workbooks.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,637
Office Version
365
Platform
Windows
In that case I suspect that you will just have to live with having both workbooks open.
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
5,262
Office Version
365
Platform
Windows
The 'Summary' sheet will be duplicated daily for specific jobs, so it's not possible to have this data in these workbooks.
Why not possible?

Open summary then
Use VBA to
- open master
- copy named range to summary
- close master
 

ryansm05

Board Regular
Joined
Sep 14, 2016
Messages
129
Wow - if this is possible Yongle, I would be ever so grateful.

Do you have any links to a thread that will help me do this?

Thanks
Ryan
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
5,262
Office Version
365
Platform
Windows
Another possibility which avoids opening Master (VBA below is pretty close to what is required)

This Excel formula gets the value from A2 in Sheet1 in closed workbook Master2.xlsx
='C:\TestArea\[Master2.xlsx]Sheet1'!$A$2

So assuming that the list of items is in range A2:A100 in that sheet (A100 being further down the sheet than ever required)
VBA can insert that formula in Daily Summary A2:A100, replace the formula (not really necessary), and create named range MyName based on range A2 to last value


Code:
Sub CreateValuesAndNamedRange()
    Dim cel As Range, ws As Worksheet
    With ActiveWorkbook
        Set ws = .Sheets("Data")
        
        For Each cel In ws.Range("A2:A100")
            cel.Formula = "='C:\TestArea\[Master2.xlsx]Sheet1'!" & cel.Address(0, 0)
            If cel.Value <> "" And cel.Value <> 0 Then cel.Value = cel.Value Else cel.ClearContents
        Next cel
        Set cel = ws.Range("A2", ws.Range("A" & Rows.Count).End(xlUp))
        On Error Resume Next
        .Names("MyName").Delete
        .Names.Add Name:="MyName", RefersTo:=cel
    End With
End Sub
It's a way to get the values into the Daily Summary without ever opening Master
The macro could be triggered when the Daily Summary is created or opened for the first time etc

How many items are there in your list?
 
Last edited:

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
5,262
Office Version
365
Platform
Windows
if this is possible Yongle
Do you have any links to a thread that will help me do this?
Should not require you to look at any links - the code is minimal

1. can you explain briefly how Daily Summary is created each day - are you simply saving an existing file under a new name ?
2. what is the name of the named range in Master?
3. which sheet in Master contains the values?

thanks

You should also consider alternative suggestion in post#9
 
Last edited:

Forum statistics

Threads
1,089,543
Messages
5,408,859
Members
403,237
Latest member
Elmo9

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top