+ Reply to Thread
Results 1 to 11 of 11

Help with VBA code to link tables together and specify formulae

  1. #1
    Registered User
    Join Date
    05-09-2022
    Location
    UK
    MS-Off Ver
    MS Office 2016
    Posts
    15

    Help with VBA code to link tables together and specify formulae

    Hi Folks,

    Attached is the sheet in question, which I am trying to do 3 things on.

    1: I am trying to link the tables such that the column names need only be changed in the table at the top (confusingly called [Table 2]). The columns currently called "Channel name", "Channel name2" and "Channel name3" will need to be change-able by a user. I would like the user to just have to change the top column names, and the other tables will update too. This needs to be able to interact with the existing 'Add Channel' and 'Clear table column' macro button functions.

    2: In a similar vein to the first problem - is it possible to link 4 of the tables which contain dates in the following way: Presently the document has 5 dates selected and populated with data. Is it possible that only the top table ('Table 2') has to have the dates selected, and the other three tables with date selections be updated to copy the top table automatically? This would save users from having to manually select the dates 4 times, and instead just do it once.

    3: 'Table 25' and 'Table 257' presently use formulae to get their data from the inputs in the other tables. The macro to clear the tables obviously gets rid of this data in these tables - but is there a way to keep these tables using the same formulae even when using the macro, and when adding a column using the 'add channel' button? It would be very helpful to keep the formulae for these tables consistent even when clearing/adding columns. But I am not sure if this is possible.

    Thanks for any help, please let me know if anything is unclear.
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Help with VBA code to link tables together and specify formulae

    Like the challenge but firts I'll need to see if I understand, I only see formulae in Table 25
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    05-09-2022
    Location
    UK
    MS-Off Ver
    MS Office 2016
    Posts
    15

    Re: Help with VBA code to link tables together and specify formulae

    Hi,

    Only Table 25 and Table 257 have formulae in - the other tables are for manual user input. For these two tables, I would like to be able to keep the formulae consistent even when using the macros, as well as my other two requests.

    Thanks

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Help with VBA code to link tables together and specify formulae

    I'll see what I can do for you

  5. #5
    Registered User
    Join Date
    05-09-2022
    Location
    UK
    MS-Off Ver
    MS Office 2016
    Posts
    15

    Re: Help with VBA code to link tables together and specify formulae

    Fab - thank you!

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Help with VBA code to link tables together and specify formulae

    Can you explain to me why you have all those hidden rows in the tables? Is that because tha values are 0?

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Help with VBA code to link tables together and specify formulae

    Some first steps but many questions on my part, questions will follow later, now it Tennis match time (Nadal v.s. Ruud)
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-09-2022
    Location
    UK
    MS-Off Ver
    MS Office 2016
    Posts
    15

    Re: Help with VBA code to link tables together and specify formulae

    Hi Apologies I have been away so haven't seen this. I've just had a look at your example and many thanks for it! I just have a few clarifications/questions.

    The rows are hidden because they are 0, yes. The user is going to be able to select the dates they have data for and put figures in, leaving the others hidden and not picked up by the table. Is there a way to keep all the dates in as options (like Table 26 remains in your version) - rather than removing them as the other tables have had? I would then like to be able to allow for the user to select the dates they want to enter in the top table, and the other tables with dates update to display these dates also.

    Thank you very much for helping automatically update the formulae in tables 25 and 257! I really like the 'remove last table column' too, really helpful and a much more useful method.


    Finally - would it be possible to allow for a user to update the column name (from the prepopulated one) in the top table to whatever they want it to be, and then have this update down the other tables? Eg. Changing the title "Channel Name" to "Something else" makes each other table header in that column change to "Something else" too?

    Thanks again for all your help on this. I'm going away at the end of this week again so might be slower replying again.

    Hope you enjoyed the final - can't stop the king of clay, can you?

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Help with VBA code to link tables together and specify formulae

    Yes, the king of clay is indeed that and most of all het has stayed himself during his carreer just like Federer, always the getleman sportsman.

    The way you explain this all I would suggest to use a pivot table which is populated accoringly and base your three charts on that.

    How many columns do you want to see in your charts? ONly three? In more then the 100% formula must be changed too at all times, this will put some more presssure on correctly formulated formulas and or VBA code

  10. #10
    Registered User
    Join Date
    05-09-2022
    Location
    UK
    MS-Off Ver
    MS Office 2016
    Posts
    15

    Re: Help with VBA code to link tables together and specify formulae

    I am mostly unfamiliar with pivot tables unfortunately so would be going in fairly blind to that.

    The number of columns is variable yes - users will be able to add and remove as many columns as they want. Realistically this is unlikely to ever be more than 12-15, but appreciate this may be an issue?

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Help with VBA code to link tables together and specify formulae

    It is if you do not provide additional code to update the three charts accordingly, I assume this is to be like a kind of dashboard?
    What values will the users be filling, all for all dates selected?

+ 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. [SOLVED] Link two different tables together over 1 code that exists in both tables.
    By luca.pe in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-02-2022, 04:03 AM
  2. Formulae in query tables
    By Bikergone ald in forum Excel General
    Replies: 2
    Last Post: 03-03-2021, 07:42 AM
  3. Slicers & Tables - How to link Slicer to mulitple tables
    By greentea in forum Excel Charting & Pivots
    Replies: 20
    Last Post: 11-25-2017, 09:31 AM
  4. VBA code to replace formulae in cells and then re-enter same formulae again after run
    By excel_msa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2017, 06:56 AM
  5. Replies: 4
    Last Post: 08-28-2014, 06:45 PM
  6. Multiple Data Tables Link and Calculate onto Target Tables
    By billexchry in forum Excel General
    Replies: 6
    Last Post: 03-04-2011, 02:42 PM
  7. Link Formulae
    By Chandra in forum Excel General
    Replies: 1
    Last Post: 09-28-2005, 06:05 AM

Tags for this Thread

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