+ Reply to Thread
Results 1 to 11 of 11

Display table location in cell - Dynamic Solution with VBA Needed

  1. #1
    Registered User
    Join Date
    07-17-2019
    Location
    Guildford, England
    MS-Off Ver
    Mac 2019
    Posts
    5

    Display table location in cell - Dynamic Solution with VBA Needed

    Hi all,

    I'm trying to create a spreadsheet to make work easier (locations of certain things in a system)

    I want to put an x in a table, and be able to pull that location out and into a cell.

    I have attached a screenshot of what I want to achieve (locations have been entered manually at this stage)

    Is someone able to help with the best way to achieve this please? I'd also like to add some checking in, so that if something is located in the same place as something else, an error comes up (say two things were in red 2 for example)

    Many Thanks

    EDIT: Ideally at some point I'd like to make this system so that it can't be edited (IE the formulas aren't displayed in the cell, but not sure how easy this is to do? My excel skills aren't too advanced!)
    Attached Images Attached Images
    Last edited by hellarda; 07-17-2019 at 05:25 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,635

    Re: Display table location in cell

    Welcome to the forum.

    Will you please attach a small sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-17-2019
    Location
    Guildford, England
    MS-Off Ver
    Mac 2019
    Posts
    5

    Re: Display table location in cell

    Thank you for the reply - apologies the first post wasn't very helpful!

    I have attached a sample of what I want to achieve, with a column containing desired outcome. I hope this helps?

    Thanks
    Attached Files Attached Files
    Last edited by AliGW; 07-17-2019 at 05:42 AM. Reason: Please don't quote unnecessarily!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,635

    Re: Display table location in cell

    Why is example 5 and error? I cannot see why you think the location is already in use ...

    The headings above the matrix - will they be there in the real workbook, or will it just be three grids with the number headings side-by-side?

    I'm not clear what the ultimate aim is here, and if I provide a solution based on this sample, I need to be sure that everything in this sample is replicated in the real workbook, otherwise my solution will fail. Make sense?

    With this in mind, is there anything else I need to know?

  5. #5
    Registered User
    Join Date
    07-17-2019
    Location
    Guildford, England
    MS-Off Ver
    Mac 2019
    Posts
    5

    Re: Display table location in cell

    Thank you!

    Example 5 is an error as red 4 is already in use by example 3. Precedent for location use should go from top down. IE if example 3 is already located at to red 4, if any subsequent items are attempted to be there, an error should be thrown.

    Basically, I want to be able to find the location of each item in the matrix, (displayed in the location cell). Ideally the location of each colour (left, centre, right) will also be pulled into the list on the LHS (as present in the other desired result column).

    The headings at the top of the matrix sections will need to be present, but this can be split into multiple cells if needed (as I know you said merged cells are a nightmare!)

    This is just the start of this, eventually I want to make this quite modular (macro buttons to change the size of the matrix etc.)

    Does this help at all?

    Thanks

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,635

    Re: Display table location in cell

    Yes, thanks - helpful. Will be back!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,635

    Re: Display table location in cell

    OK. Get rid of the merged headers for now and fill the first 10 cells with Red, the next 10 with Green and the final 10 with Blue. You can hide this row later and put your nice merged headings above it.

    In E6 copied down:

    =IF(COUNTIF($H6:$AQ6,"x")>1,"!Error! - Double Patched",IF(COUNTIF(E$5:E5,INDEX($H$2:$AQ$2&" "&$H$3:$AQ$3,,MATCH("x",$H6:$AQ6,0)))>0,"!Error! - Duplicate Entry",INDEX($H$2:$AQ$2&" "&$H$3:$AQ$3,,MATCH("x",$H6:$AQ6,0))))

    In C6 copied down:

    =IFERROR(LOOKUP(LEFT(E6,FIND(" ",E6)-1),{"Blue","Green","Red"},{"Right","Centre","Left"}),"")

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,635

    Re: Display table location in cell

    This is just the start of this, eventually I want to make this quite modular (macro buttons to change the size of the matrix etc.)
    Uh-oh! This is worrying ...

    OK, well my solution is not going to work when you start doing that, sadly.

    I won't be helping any further with this, as I think the whiole thing will need to be VBA driven. I think we need to move this to that section. Do you agree?

  9. #9
    Registered User
    Join Date
    07-17-2019
    Location
    Guildford, England
    MS-Off Ver
    Mac 2019
    Posts
    5

    Re: Display table location in cell

    Thank you for both replies and your help! - The above solution is great for a start whilst the spreadsheet isn't too complex and works exactly desired so thank you!

    Yes - that probably is the best idea. My general programming skills are ok, but I don't have any direct experience with VBA.

    Thanks
    Last edited by AliGW; 07-17-2019 at 06:29 AM. Reason: Please don't quote unnecessarily!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,635

    Re: Display table location in cell - Dynamic Solution with VBA Needed

    OK - I've moved the thread. Good luck with your project.

  11. #11
    Registered User
    Join Date
    07-17-2019
    Location
    Guildford, England
    MS-Off Ver
    Mac 2019
    Posts
    5

    Re: Display table location in cell - Dynamic Solution with VBA Needed

    Hi all,

    As above really. looking for a way to implement this - and VBA seems to be the way forward. I have basic programming skills, but limited knowledge of VBA.

    Thanks

+ 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. Replies: 1
    Last Post: 05-24-2018, 11:12 PM
  2. Dynamic Table of Store/Bank with location assignment (Dynamic Inventory)
    By x_ampl1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2017, 01:58 PM
  3. Dynamic, permanent solution needed
    By noobasaurus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-29-2014, 09:05 AM
  4. [SOLVED] Various Concat (or any other smart solution) needed -1000 lines messy table
    By edskal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2014, 04:49 PM
  5. [SOLVED] Table Display. Probably a Match or Sum Product Solution Needed
    By Jay_hl in forum Excel General
    Replies: 1
    Last Post: 12-03-2012, 09:45 AM
  6. Dynamic list solution needed...VLOOKUP?
    By drumbok5 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2012, 12:42 PM
  7. Cell Hyperlink to a Textbox Location - Macro Solution?
    By Desolatemm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2012, 12:54 PM

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