Lists from second workbook

ryansm05

Board Regular
Joined
Sep 14, 2016
Messages
148
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Yes but unfortunately this requires both workbooks to be open.
This is the issue I'm trying to avoid?
Thanks
 
Upvote 0
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.
 
Upvote 0
In that case I suspect that you will just have to live with having both workbooks open.
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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:
Upvote 0
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:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top