+ Reply to Thread
Results 1 to 7 of 7

Create a table with size based on a formula (VBA)

  1. #1
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Create a table with size based on a formula (VBA)

    Hi,

    I need a macro to create a table with a size based on a formula and in which the values in the table are also formulas. An example is provided in attachment.

    How can I do this?

    Thanks
    Attached Files Attached Files
    Last edited by Coaster; 05-08-2010 at 11:46 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Create a table with size based on a formula (VBA)

    You will have to be more explicit in the details of what you are wanting to accomplish. Your attachment does not help to explain or clarify your post.

    Please provide a more clear explanation and upload a revised attachment that includes an example of the results you want.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Create a table with size based on a formula (VBA)

    Thank you for your reply

    I'm sorry I wasnt' clear, I think with this file things are more clear.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create a table with size based on a formula (VBA)

    How critical is the "formula" part of this? Once you move to VBA, it's simpler to just put the values directly into the table.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Create a table with size based on a formula (VBA)

    The thing is:
    - input: data in a column (going up to 7000 rows or so)

    - output: a table with that data organized the way it is in the excel file

    The thing with the formula is that it is completely automatic. Putting the values directly into the table doesn't allow me to use the same code if the size of the table changes, for example.

    See what I mean?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create a table with size based on a formula (VBA)

    I was simply referring to the fact that once you move to VBA you can edit your "data" and rerun your macro to reassert your table at anytime, there's no need to maintain formulas in the table itself, it seems like plumbing you just don't need once you go to VBA.

    This shows what I mean. I moved all the Input cells to the left so they do not interfere with a table size that could be any size. This will create the table starting in column H and go out as far as needed.

    1) Put data in column B
    2) Fill out the start, end and increments section
    3) Click the button to create the table.
    4) Change any of the inputs and click the button again to reassert the table

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JBeaucaire; 05-08-2010 at 11:34 AM.

  7. #7
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Create a table with size based on a formula (VBA)

    my god!

    this is priceless, will save tons of time!

    THANK YOU! )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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