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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

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,536
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,536
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,250
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,250
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,250
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,267
Messages
5,407,262
Members
403,131
Latest member
Lewas2019

This Week's Hot Topics

Top