+ Reply to Thread
Results 1 to 9 of 9

Need assistance creating a dynamic table

  1. #1
    Registered User
    Join Date
    12-04-2013
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2007
    Posts
    6

    Need assistance creating a dynamic table

    Hey All,

    So what I would like to do is have a spread sheet that prompts the user to input a set of data related to one object. On completing this set, the data will then be added onto a new column in a separate table. From here, the next set of data can be entered, and so on. Could someone explain to me in simple terms how this could be achieved?

    Cheers!
    Chris
    Last edited by chris.excel; 12-04-2013 at 10:47 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need assistance creating a dynamic table

    Welcome to the Forum chris.excel!

    This requires a macro. What event do you want to trigger the prompt to the user? Here is an example that does it with a button.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need assistance creating a dynamic table

    Since I developed an answer to your question, you have edited your post to be a completely different question than the first one you asked. (This is not generally a good idea, better to start a new thread.) Please create an example of what you want this to look like. What does "new column in a separate table" mean? Are you creating a new separate table each time, or just a new column to an existing table?

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Need assistance creating a dynamic table

    Hi Chris and welcome to the forum,

    Your question sounds like you need to learn about Dynamic Named Ranges.... See
    http://www.bettersolutions.com/excel...G820716330.htm
    for more info on that topic.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    12-04-2013
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need assistance creating a dynamic table

    Sorry Jeff, I will keep that in mind- wasn't expecting such a quick response haha!

    What you sent looks great. What Im looking for would be similar to that button system, however it would require multiple inputs, and then add this data as a new column onto an existing table

  6. #6
    Registered User
    Join Date
    12-04-2013
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need assistance creating a dynamic table

    ok so i've got the main code ready as follows:

    Please Login or Register  to view this content.
    This works fine, however, when i have finished running the macro and would then like to re-run it, i need the next set to data to begin in the next empty column rather than replace column B. i.e C, then D and so on. Any thoughts?

    Thanks
    Last edited by 6StringJazzer; 12-05-2013 at 09:58 AM. Reason: code tags

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need assistance creating a dynamic table

    Chris, please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires "code" tags around code to preserve readability. I have added them for you because you're a new member. Here is the rule:

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need assistance creating a dynamic table

    This code will work if the table is the only data in the active worksheet. It depends on using UsedRange to figure out what columns are being used, and if there is any data to the right of the table it will add it there instead of the table.

    Please Login or Register  to view this content.
    You will notice that instead of selecting a cell, then acting on the ActiveCell, this code assigns the value directly to the cell. Your code is typical of what a macro recorder will do, although the approach here is best practice.

    I also used Cells instead of Range. It can be done with Range, but when your target column is a number instead of a letter this is more direct.

  9. #9
    Registered User
    Join Date
    12-04-2013
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need assistance creating a dynamic table

    Really appreciate the help Jeff- this code is just what i need

+ 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. Creating a Dynamic Matrix Table in Excel
    By koohee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-28-2013, 01:17 PM
  2. [SOLVED] Creating new Pivot table with dynamic sheet names/ranges
    By KeriM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 08:54 AM
  3. [SOLVED] New to VBA and need some assistance with creating a Pivot Table using a Macro
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2012, 10:05 AM
  4. Creating a dynamic table
    By kmoore in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2011, 04:05 PM
  5. Replies: 1
    Last Post: 07-26-2010, 03:59 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