+ Reply to Thread
Results 1 to 16 of 16

Sort and input through spreadsheet

  1. #1
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Exclamation Sort and input through spreadsheet

    Hello everyone,

    I am brand new at using VBA and I am having a ton of irritating issues and I would really appreciate it if I would be able to recieve some help!

    I am working on a large spreadsheet with a large set of data and I need to ask the user for input and sort through the spreadsheet to see if the user's input of a number is already in the spreadhseet, if so, i need to insert a row below and as the user to input the new data for each cell.

    I am not sure if that makes any sense, but this is what i have so far.

    Thank you so much in advance!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Sort and input through spreadsheet

    I think your situation is the ideal candidate for a UserForm. Would make your life and the user's life a lot easier.

  3. #3
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    Quote Originally Posted by stnkynts View Post
    I think your situation is the ideal candidate for a UserForm. Would make your life and the user's life a lot easier.
    stnkynts,

    I have no idea how to go about doing that, but I will try!
    Thank you for putting me on the right path!

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Sort and input through spreadsheet

    For your situation think of a UserForm as a giant input box where instead of having your code prompt you with 10 input box questions you just have 1 userform with all the questions on it. The user would then fill out the questions and the answers would be applied to the worksheet. If you get a UserForm created with all the questions you want and associated textboxes submit it and we can probably work up some code quickly for you.

  5. #5
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    Quote Originally Posted by stnkynts View Post
    For your situation think of a UserForm as a giant input box where instead of having your code prompt you with 10 input box questions you just have 1 userform with all the questions on it. The user would then fill out the questions and the answers would be applied to the worksheet. If you get a UserForm created with all the questions you want and associated textboxes submit it and we can probably work up some code quickly for you.
    stnkynts,

    Thank you so much for all of your help.
    This is what I came up with so far!

    screenshot_userform.jpg

  6. #6
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    Here is a sample of what the whole excel spreadsheet would look like.macros_excel_sample.xlsx

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Sort and input through spreadsheet

    Your submitted workbook does not have a userform.

  8. #8
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    Quote Originally Posted by stnkynts View Post
    Your submitted workbook does not have a userform.
    stnkynts,

    Is it avialable on this one?
    I have no idea why it did not show up on the previous one...
    I also Wrote some code for this userform, however it keeps giving me errors and i have no idea how to fix it...
    And my other issue is that i need it to input this information afte rit scans through old sets of information and sees if a submittal number is already there and if so, it inputs this new information underneath it...

    Thank you!Master Submittal List Macro - Copy.xlsm

  9. #9
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    And if it is still not there... since I have no clue the reason for that,

    here is the code:

    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Sort and input through spreadsheet

    I started working on this then realized what you said in your posts and what you have as data on your sheet makes no sense.

    I am working on a large spreadsheet with a large set of data and I need to ask the user for input and sort through the spreadsheet to see if the user's input of a number is already in the spreadhseet, if so, i need to insert a row below and as the user to input the new data for each cell.
    "User's input of a number" - What input is this? Do you mean the CDRL ID #? If so your supplied data has only 3 numbers in an odd orientation with different formatting based upon cell location.
    "See if.....already in spreadsheet" - What should be done if it doesn't find this number? What if there are multiple numbers found?

    I am going to needmore specific information to continue.

  11. #11
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    stnkynts,

    I was referring to the Submittal Numbers. I want the spreadhseet to be searched based on the Submittal numbers. If the submittal number that is inputted by the user is found in the spreadsheet then the information which the user inputs for all the other fields will be inserted in the spreadsheet after the found submittal number. If the submittal number which is searched for is not found, then the input from the user should be placed at the bottom of the spreadsheet. And if there are multiple numbers it should place the information after the last number which was found.

    Does that make more sense? It makes sense in my mind, knowing exactly where i want/need to go with this, but i am not sure if it makes sense when trying to explain it.

    Thank you so very much for all of your help!

    Quote Originally Posted by stnkynts View Post
    I started working on this then realized what you said in your posts and what you have as data on your sheet makes no sense.



    "User's input of a number" - What input is this? Do you mean the CDRL ID #? If so your supplied data has only 3 numbers in an odd orientation with different formatting based upon cell location.
    "See if.....already in spreadsheet" - What should be done if it doesn't find this number? What if there are multiple numbers found?

    I am going to needmore specific information to continue.

  12. #12
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Sort and input through spreadsheet

    There are still quite a few issues. I addressed as many of them as I could. The userform_initialize has some problems I didn't address.

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    Thank you very very much! I will continue to work on it and try and figure out the issues.

  14. #14
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sort and input through spreadsheet

    So I made all of the changes that u suggested and i added some more code, and i get an error message.
    I mean the code runs and it shows the userform and it can be filled out, but when u try and click ok or cancel it gives me an error message saying: "Run-Time error '1004':Method 'Range' of object '_Worksheet' failed"
    and i have no idea what that means or what to do about it. change the range?

    This is the new code:

    Master Submittal List Macro - Copy.xlsm
    Please Login or Register  to view this content.
    Last edited by alxx_i; 04-24-2014 at 09:02 AM.

  15. #15
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Sort and input through spreadsheet

    You cant just move code around as you did. For example why did you move these lines of code to a textbox_change event when the variable LR was being used under a different subroutine.
    Please Login or Register  to view this content.
    If you are trying to have the row inserted immediately once you enter a value, you would just need to publicly declare the variable so the other subroutine can access it.

    As to your question about the Run-Time Error, I was not able to duplicate it.

  16. #16
    Registered User
    Join Date
    04-21-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Exclamation Re: Sort and input through spreadsheet

    Master Submittal List Macro - Copy.xlsmHello,

    So I added a bunch of code and changed some stuff around.

    I need help though! i am completely lost and frustrated and I tried to figure this out on my own but it hasn't taken me anywhere! I have read plenty of forums and tried a ton of different things and it still doesn't work! I am completely frustrated!

    PLEASE HELP!

    So I need to do a couple of things now:
    1. Make it so that the OK, Clear and Cancel Command buttons work. The cancel works and the OK works sometimes. The Clear button is a bit glitchy.
    2. It will no longer complie and I don't understand why
    3. I need to make the user form input the information that is entered by the user in specific spreadhseets within the one workbook. This information has to be eneterd based on the milsestone option the user chooses. The information has to also be posted in the Master Submital List sheet though, because that list contains all the information in one!

    I cannot even tell what is working and what is not anymore :'( Please please help!

    Here is the code and I will also attach a sample workbook so you have an idea of what I am trying to do:

    Please Login or Register  to view this content.
    Last edited by alxx_i; 05-02-2014 at 03:01 PM.

+ 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. [SOLVED] Lookup values in one spreadsheet and automatically input into another spreadsheet
    By prefcomm in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-08-2013, 05:26 PM
  2. Sort spreadsheet based on another spreadsheet
    By Rat A Tat in forum Excel General
    Replies: 0
    Last Post: 10-12-2011, 11:18 AM
  3. Sort Macro and input Box
    By Althas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-11-2007, 06:30 AM
  4. Sort Without User Input
    By guilbj2 in forum Excel General
    Replies: 2
    Last Post: 05-11-2006, 10:25 PM
  5. Sort Based off of an Input Box
    By Nathan Bell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2005, 01:06 PM

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