+ Reply to Thread
Results 1 to 4 of 4

VBA to Grow/Shrink Part of a Worksheet

  1. #1
    Registered User
    Join Date
    07-18-2011
    Location
    Ruidoso NM
    MS-Off Ver
    Excel 2010
    Posts
    62

    VBA to Grow/Shrink Part of a Worksheet

    Assuming I can insert a picture here, I'm looking for general thoughts on how to proceed. I have a worksheet with a checkerboard-like matrix; some squares will have X's in them, reflecting the "skillsets" of the listed members. Tricky part is, I need the matrix and associated headers and footers to grow or shrink depending on how many persons are listed vertically and how many "expertise" and "influence" items are involved. (The user organization will determine both of those things as part of the initial setup.) I have the necessary VBA worked out to "grow" the actual list of persons in columns A through E, but have been thinking for a couple days now about how to handle changing the width and length of the matrix itself. I've made copious use of range naming, and each square in the matrix contains a formula involving a custom VBA function, as do the colorized cells shown horizontally beneath the matrix. So there's a whole lot more involved than just inserting cells. Anyone who wants to opine on this challenge, or who can point me to a tutorial or whatever that might help me overcome my mental block, please chime in.

    Capture.jpg

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: VBA to Grow/Shrink Part of a Worksheet

    I'd suggest capturing a worksheet change event, and if target cell matches row 1 / columns A:E (? can't tell from jpg) then copy formulae & formatting from prior column / row (or delete them), as relevant.

    It's really hard to be more specific when working from a JPG, though. An attached workbook would be a lot better.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-18-2011
    Location
    Ruidoso NM
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: VBA to Grow/Shrink Part of a Worksheet

    Well, here's the whole workbook then. Its purpose is to let an organization keep track of its Board of Directors: when they will reach the end of their term, and what skills each of them brings to the table. The starting point is the worksheet called "Lists," where the user initially sets up various things. For any given organization, the Board could have three members, or five, or fifty, and the skillsets (broken into Expertise and Influence categories) can also vary from a few to a lot. So the matrix, which is in the "Recruitment Forecast" worksheet, has to be re-sized as part of the initial setup, in both the horizontal and vertical dimensions, and if there are changes at some later point -- more or fewer board members or skillsets -- then the resizing needs to happen again. Given the complexity of the whole thing, though, that's not something most of the users will be able to handle, hence my need to fully automate it if possible. In essence, every time that report is opened I want the workbook to say "Is the matrix still sized correctly?," and if not, perform all the necessary steps to resize it. Hope that is sufficient explanation. This is still very much a work in progress, and this resizing thing is my next major hurdle.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-18-2011
    Location
    Ruidoso NM
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: VBA to Grow/Shrink Part of a Worksheet

    Appears I've "stumped the band" on this one. No problem, I can do it all in VBA, was just hoping there's some magic feature built into Excel 2010 that I was unaware of that would be perfect for this situation.

+ 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. can a cell grow and shrink with it's contents?
    By -Brian-H- in forum Excel General
    Replies: 10
    Last Post: 09-27-2008, 04:56 PM
  2. Replies: 12
    Last Post: 08-15-2006, 06:40 PM
  3. Creating reports that grow/shrink
    By dsanita in forum Excel General
    Replies: 0
    Last Post: 07-25-2006, 05:00 PM
  4. Worksheet Change Event-an grow and shrink
    By GerbilGod7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-08-2006, 12:16 PM
  5. Can rows/columns Automaticly Grow/Shrink?
    By Brw in forum Excel General
    Replies: 0
    Last Post: 03-24-2006, 10:35 AM

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