+ Reply to Thread
Results 1 to 7 of 7

Macro to fill up a table from a User Form information

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Macro to fill up a table from a User Form information

    Hello Everyone,

    I have found this forum really helpful, and I have decided to join. I have a question. Any help is very much appreciated.

    I have an excel table that contains many columns with different information that is imported from a macro User Form. The problem that I found is that if I add more columns in between, I have to go and change all the row-column references. This is basically what I have:

    Please Login or Register  to view this content.
    This code is simple. Just saves whatever is written in the form's text box, combobox, etc to the excel sheet. I think the easier solution is to define a table, then name the columns to make them absolute references, so if I put cells in between, it wont enter the info in the wrong column. The problem is that I haven't found the way or probably I am trying to apply a wrong concept.

    I will greatly appreciate your help

    Thank you.

    Diego C.
    Last edited by Cutter; 07-30-2012 at 03:20 PM. Reason: Added code tags

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Macro to fill up a table from a User Form information

    Could you upload a sample of your workbook? I'm not sure absolute reference but I think you could use find method to find a header row.

    Thanks!

  3. #3
    Registered User
    Join Date
    07-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro to fill up a table from a User Form information

    Thank you rvasquez. I will upload it.

    What I am trying to do, is to keep the data going to the correct columns even if I add more columns in between at a later time without going to the VBA code and change all the references.

    Thank you!

    Diego C.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Macro to fill up a table from a User Form information

    Hello there,

    Attached is your original workbook updated to include some code at the beginning of your on save button click event.

    Try it out and let me know if it works for you.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro to fill up a table from a User Form information

    Thank you rvasquez. I really appreciate it. I didn't think of that as a solution. It works perfect. Thank you!

    Diego C.

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Macro to fill up a table from a User Form information

    No problem.

  7. #7
    Registered User
    Join Date
    07-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro to fill up a table from a User Form information

    Do you know if instead of looking to match the Text in the cell, could I check if matches the name of the cell?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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