Updating lists based on a table.

HomeTek

New Member
Joined
Jan 27, 2017
Messages
42
Office Version
  1. 365
Platform
  1. Windows
Hi all.

I have a list of items that i have converted into a table (because it makes it easier to update list validation drop downs that I have elsewhere).

However, I have several other lists which use the items in this list as a source, but if I update the table by adding extra items, I then have to also manually update the other lists that I have which use this table as a source.

Is there anyway that this can be automated, perhaps similar to how when I update the table the items in my list validation drop down options also update.

The below is just an example of what I mean.

XfLj1R.jpg


Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Sounds like you need to turn the second list into a table.

Select somewhere in in and press ctrl+T then ok.
 
Upvote 0
Sounds like you need to turn the second list into a t8able.

Select somewhere in in and press ctrl+T then ok.

Thanks,

That's something I did originally try, but it didn’t solve the problem of needing to update it manually.

At present all the items in that secondary list have the following formula

=ListSource[@RangeSource]

Then of course I still need to drag the formula down for it to pick up further items if they have been added to the main source list.
 
Upvote 0
Hi, HomeTek
Try this:
- Convert your secondary list to a table
- So say your table name are Table1 & Table2 (and I assume both are in the same sheet), put this code in the sheets code module:

Code:
[FONT=lucida console][COLOR=Royalblue]Private[/COLOR] [COLOR=Royalblue]Sub[/COLOR] Worksheet_Change([COLOR=Royalblue]ByVal[/COLOR] Target [COLOR=Royalblue]As[/COLOR] Range)
[COLOR=Royalblue]If[/COLOR] [COLOR=Royalblue]Not[/COLOR] Intersect(Target, Me.ListObjects([COLOR=brown]"Table1"[/COLOR]).DataBodyRange) [COLOR=Royalblue]Is[/COLOR] [COLOR=Royalblue]Nothing[/COLOR] [COLOR=Royalblue]Then[/COLOR]
    Application.EnableEvents = [COLOR=Royalblue]False[/COLOR]
    n = Me.ListObjects([COLOR=brown]"Table1"[/COLOR]).Range.Rows.Count
    [COLOR=Royalblue]With[/COLOR] Me.ListObjects([COLOR=brown]"Table2"[/COLOR])
    .Resize .Range.Resize(n)
    .DataBodyRange.Value = Me.ListObjects([COLOR=brown]"Table1"[/COLOR]).DataBodyRange.Value
    [COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]With[/COLOR]
    Application.EnableEvents = [COLOR=Royalblue]True[/COLOR]
[COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]If[/COLOR]

[COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]Sub[/COLOR][/FONT]
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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