+ Reply to Thread
Results 1 to 10 of 10

Adding new records in table and sorting it.

  1. #1
    Registered User
    Join Date
    06-16-2022
    Location
    Poland
    MS-Off Ver
    2019
    Posts
    18

    Adding new records in table and sorting it.

    Hello everyone,

    I am tried to make a pretty simple form for my small company but I do not know exacly how to do it.

    I written the "core" of what I am trying to achieve. The main goal is to have a user operated sheet 'New_records', and user is only selecting things listed here - 'cat.','name','type' should be selected from list (according to viable options in 'helper' sheet), 'qty' and 'price' should be typed by hand, and if it is possible date should be changed according to real time (but also with possibility to change it into past one)

    And at the end of it - after pressing button, this new record should go to the table in sheet 'All_records'.

    I tried to do it on my own in VBA, but I am lost cause - I have no idea how to do it. Is there anyone who can help me?

    Best Regards!
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,309

    Re: Adding new records in table and sorting it.

    here is a starter using VBA/UserForm
    have a trial, any questions post back here.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Adding new records in table and sorting it.

    Hello.
    Here is another way:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-16-2022
    Location
    Poland
    MS-Off Ver
    2019
    Posts
    18

    Re: Adding new records in table and sorting it.

    Awesome! Thank you guys.

    Didn't hear about user form before, but BeyondExcel did exactly what I was thinking about. But only one more question, how to change date to european standard (dd.mm.rrrr)?

  5. #5
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Adding new records in table and sorting it.

    .
    Your comment confuses me. We'll see:
    - Dates are presented to me in "cell G3" as day/month/year.
    - And when a record is saved I see it in the same way: day/month/year.

    Could you tell me how you see both situations?

  6. #6
    Registered User
    Join Date
    06-16-2022
    Location
    Poland
    MS-Off Ver
    2019
    Posts
    18

    Re: Adding new records in table and sorting it.

    Hello,

    Screenshot_5.png

    this is what I see in 'new_records' sheet, and after saving it changes into 30.08.2022

  7. #7
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Adding new records in table and sorting it.

    .
    Hello.
    Let's try the following before applying "major surgery":

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by beyond Excel; 08-30-2022 at 09:45 PM.

  8. #8
    Registered User
    Join Date
    06-16-2022
    Location
    Poland
    MS-Off Ver
    2019
    Posts
    18

    Re: Adding new records in table and sorting it.

    Works really great! Thank you for your help.

    I have last question for you. Can u make that every time I add 'sell' record it will add to table average price from table? But actual value at the moment of adding record - becasue I do not know where table with this value will be I just set up a temporary solution in example and I hope i will know how to edit code to add more variables to all records/change positions of exisiting ones.

    Thank you very much again.
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Adding new records in table and sorting it.

    .
    Hello.
    I modified the Helper sheet table

    Taking this information into account, indicate in column G (of the Helper sheet) which of these rows will contribute their respective data to the Avg. Price column of the All_Records sheet.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-16-2022
    Location
    Poland
    MS-Off Ver
    2019
    Posts
    18

    Re: Adding new records in table and sorting it.

    Sorry, but I think I do not understand it. I want to have a circle like in attached jpeg - is it possible to be done? Or maybe you will tell me if there is a better soultion than what I want

    Attachment 794802

+ 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. Adding a sorting button to a table to sort as desired
    By mj_bowen in forum Excel General
    Replies: 1
    Last Post: 06-10-2012, 11:37 AM
  2. Adding records to a table with code
    By laguna92651 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-07-2012, 06:46 PM
  3. sorting Id for unique records
    By teanar in forum Excel General
    Replies: 1
    Last Post: 09-14-2011, 11:03 AM
  4. Sorting table then adding blank rows
    By kgrula in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2011, 11:05 PM
  5. Replies: 6
    Last Post: 07-29-2009, 03:45 PM
  6. Excel 2007 : Sorting 30,000 records takes an age
    By D@vid in forum Excel General
    Replies: 1
    Last Post: 07-16-2009, 12:55 PM
  7. Line up records (sorting)
    By Brian Issa in forum Excel General
    Replies: 2
    Last Post: 09-12-2005, 03:37 PM
  8. Sorting Records
    By reese in forum Excel General
    Replies: 2
    Last Post: 04-07-2005, 06:06 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