+ Reply to Thread
Results 1 to 52 of 52

Need help writing macro to input data in Different row each day: details inside

  1. #1
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Need help writing macro to input data in Different row each day: details inside

    Hey guys your expertise is required

    I am creating a database where data on different people are entered on a daily bases, using the days date as the unique marker for my Vlookup search. the thing is I want to create a user form for inputting the data but since the amount of data which will be entered on any given day will vary (hence varied cell ranges). I am not sure how to code a macro which will automatically transfer the data to the worksheet for each day and automatically move to the next day which will be in the next row. I had a crazy thought that maybe it was possible to have the data start in a new row each day using the NOW function (i am just musing as i don't know if that's even possible.


    Well guys that my problem, anyone has a solution that will achieve my objectives?

    assistance in this regard will be much appreciated.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Attach a before and after example.
    No sensitive information/names but a true representation of your wishes.

  3. #3
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I have attached a copy/example of one of the sheets i am referring to which i have already created a simple vlookup in another sheet to pull up all the offences committed on a particular day. i want to create a user form which will help me to easily input this data into
    the sheet you see there, in that format, with each row representing a new day. i want to create a user form to more easily input this
    data in the daily offences sheet, in the format as you see it. the issue is this, the number of cases on a daily bases varies, therefore i am having issues figuring out how to code the user form so that i can get to the end of a day and have new data inputted in the next row in the same format.
    if the number of cases addressed on a given day was static then i would know at what range to end the process and use the xldown function to start in the next row but since the data inputted on each day varies i don't know how to code for this.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Try attached.
    It gives you an option for the date. You won't always have a next date being today, or yesterday, + 1 (Holidays, weekends, no offences)
    Try lots of scenarios.
    See what you think.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    This is perfect. Thanks a Million I was trying to get a look at the code to see if i could replicate and modify to suit similar records and to develop my knowledge going forward but I have been unable to do. how come?

  6. #6
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    especially the form that comes up prompting "continuation" or "new date" how do i view those codes along with the code for the data input form that comes up?

  7. #7
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    never mind i just saw all the coding, thanks a million again man. you have cut my work time literally in half

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Glad it works for you.

    Good luck

    John

  9. #9
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Hopefully you wont mind me bouncing a few other problems/ideas off you as I update my record updating and retrieval systems using excel
    Last edited by Pimp_mentality; 10-04-2015 at 06:28 PM.

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    If I have the time and if I know how to solve it, no problems but the way to go is to start a new thread, if you want you can refer to this thread, for every new problem.
    The advantage is that more people will have a look at it and you might get different answers to pick from.
    See you back soon

  11. #11
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Good idea i think i will try that i.e staring a thread for my update project

  12. #12
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I have been trying to modify the Macro you wrote so that I can use it in other worksheets that I have been having similar issues with. This has been unsuccessful due to my less than advance coding knowledge. My issues are these:

    I am trying to modify the Macro so when the first text box appears after I select "get userform", Instead of having the option to "continue" or "start new date". I would now like to continue adding information to the row of an existing id# or start new id# in the next empty row and input data in that new row. The concept is this, to update a student’s records for a particular offence (cautions issued) regardless of the day they commit the offence. So in essence i would like to be able to add data to existing id # at any time or start new id # in the next empty row and start adding data there. I have included a sample of what I am referring to; it’s a sheet containing letters of caution issued.
    Once I get this sorted I should be able to modify this new macro into several different sheets with different data but the same data entry concept.

    P.S.
    I attempted to outline my entire Dilemma in a separate thread but as I re-read the post it kinda sounded like I wanted persons to do most of the work for me when that's not my intent. I prefer to go through each issue and when I meet up on an issue my limited knowledge cannot solve, I seek assistance, this way when I examine the code, as I have, and learn much more that way.

    In any event assistance in this regard would really be appreciated.
    Attached Files Attached Files
    Last edited by Pimp_mentality; 10-05-2015 at 10:38 AM.

  13. #13
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Re: "the cautions issued to a particular id#"
    Do you want to go by ID or by Name? The person's name normally will not change, a nummer can.
    When you see a person, do you see him/her as a number or as a person with a name?

    I am asking this for when you search when it is a continuation. Search by name would be the most logical in my opinion.

  14. #14
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I thought about names earlier on but then I ran into the problem of a few students having the same name , hence my use of an id numbers. So what I did was had a sheet on which only names grade and id# are stored then on top of each search area on each offence sheet I had a secondary Vlookup search area where the user (me ) would simple type in the students name to get the id# of that student.

  15. #15
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    If I was you I would seriously look into having just one workbook with everything in it. You then don't have to worry about making sure you have the right workbooks open to pull information from etc.
    All information required can be pulled from a single sheet. You sort, filter, count and so on.

  16. #16
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    that's actually what i am trying to do, I initially had two work books one with sheets dedicated to data input and one with sheets dedicated to data search, as this was the extent of my coding skills i.e. simple vlookup and data validation functions. the whole purpose of this exercise that i have undertaken is to have one workbook where data can be imputed and pulled easily and quickly.

  17. #17
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I initially had two work books one for data input of the different events and on for data storage, using simple Vlookup functions. but the more i read and studied on the feature of excel I have started to figure out how to code for user forms and such. so yes, the goal is to consolidate the data in one work book.

  18. #18
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Play around with this.
    If it is a new ID/Name, it will be entered and you'll have to select it from the Listbox when it pops up.
    It should solve the duplicate names problem as you'll have both the ID and Name in the Listbox.

    Good luck

    John
    Attached Files Attached Files

  19. #19
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    This is excellent John. i only have one concern though and that the is the second form that come up for new id input which has a nice list of student. In a few months that list is gonna have over 200 hundred students. is there a way to zero in on just the student ifo being inputted or the student for which data records are being updated?

    in any event this is great stuff and i am much appreciative of it

  20. #20
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Good Day John, I have been trying to duplicate the code you wrote into other worksheets but am unable to do so properly as i keep getting run time errors. What i did was copy the "Get userform" button over to the other work sheet then attempt to modify the code to suit the sheet in question. i included two examples of what i am referring to. VBA1 shows the points i tried to modify. So essentially I changed the name of the sheet from CAUTIONS to the name of the sheet I was now working. I then changed the "i" as highlighted to "L" as that was the row in which the new id entries would start. this produced no success. VBA2 shows another error that debugging would show sometimes.

    so i also included the form for i am speaking. The same concept of data entry which you coded for me in the last caution sheet is what i would like to duplicate in this sheet and about 4 others similarly but possessing different info. so if you would identify what i am doing wrong and what parts of the code i need modify i could properly do it for the other sheets
    Attached Images Attached Images
    Attached Files Attached Files

  21. #21
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Don't copy the buttons over. That is asking for troubles as you have to assign the new macro from the workbook where the button is in to it.
    If you don't assign a new macro to it it will want to run the original assigned macro to it even if you copy the code over..

    "L" is not a Row but a Column. The small i is not a Column Header but a counter
    For i = 4 To 8 means that the first time the i is encountered it will have a value of 4, the next time a value of 5, next 6 etc etc.

    In the attached workbook you have no before and after which makes it impossible to test.

    Put something in it that is realistic so one can test it.

    Regards

    John

  22. #22
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I have attached an actual example with an entry so you see what I am referring.
    Since you have stated that it is a very bad idea to try to modify the copied VBA coding, could you please advise how best I can use the same concept, or modify the code for different sheets I am working with re being able to start a new entry for a new student or continue entering data for an existing student in the database

    Also, I notice when I try to merge all the sheets into one workbook the macro no longer works, why is this and whats the best way to merge all the books into on workbook and have the macros function properly
    Attached Files Attached Files

  23. #23
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    I did not say that it is a vary bad idea to modify the copied code. Just make a new button and assign it to the code.
    If you use it for new and different sheet set-ups, change the sheet names, range/cell references etc etc. It is mostly trial and error when you start with this.
    I think that I mentioned it before but my personal preference is to have all information in one sheet only and filter on a subject that you want to look at, copy/paste or print.

  24. #24
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Ohh. Now I am clearer in my understanding, I do want to consolidate all my worksheets into one document. Now that know what to do I will create new buttons in each sheet and re write the code making the relevant changes. i will up date you as I go. Many thanks again.

  25. #25
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Good Day John,

    I have attempted to completed phase 1 of the revamping of my system. I have attached an example of what i have done for you to look at for me, as I have not seem to have gotten the coding correct. I made a few adjustment to the original code written for me by you (the one for putting in new data or continuing with old data)to account for all my worksheets which are all now on one work book. I now have one worksheet within the work book which will be dedicated to data input into the other sheets. once I have accomplished that I will create another sheet for pulling data using Vlookup, they I plan to hide all the other data sheets leaving only the data input sheet and the look up sheet for a cleaner look.

    the issue now however, which I am hoping you will be able to assist me with, is to solicit your assistance in looking at what I have done and seeing where i have made errors in the coding why my forms aren't launching when the varied command buttons are clicked.

    Oh as the file went up to 2.2MB (which is funny since its just about 7 sheets with very little info in them) and the forum does not allow uploads that size I had to compress the file. Hope that's not an issue

    Your assistance thus far has been greatly appreciated and your further assistance will be also appreciated.


    Regards, Romain
    Attached Files Attached Files

  26. #26
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    http://peltiertech.com/how-to-assign...tton-or-shape/

    Read about the different Buttons. (Form Control and Active X). Google for some more information.

    Clear DATA INPUT FORMS Code sheet
    Put this code in a code module (Module1)

    Please Login or Register  to view this content.
    If you're going to use a Forms Control Button, use
    Please Login or Register  to view this content.
    If your file is proportionately large, google for "Excel Bloat" or "Excel File Very Large" or anything where you expect to see something about too large a file.
    Read as many as you can as there are lots of reasons why a file gets very large.

  27. #27
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I have cleared the DATA INPUT FORMS as you stated, created the module and put this code

    Sub Show_It_To_Me()
    UserForm8.Show
    End Sub

    However when I try to run the macro i.e. when I click the button I labeled "click to get input forms" nothing happens (UserForm8 should pop up enabling me to navigate to the different input forms from there).

    Also when I run the macro from the VBA Project screen it pops up but when I make a selection I get a run-time error '9' subscript out of range.

  28. #28
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Attached example will show what is what.
    I am sorry that I explained it wrong before.
    Attached Files Attached Files

  29. #29
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    thanks, got that working, now when i click any of the buttons on UserForm8 i get runtime error 9

  30. #30
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    when i debug this is what is identfied as the error. see pic
    Attached Images Attached Images

  31. #31
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    You have to compare apples to apples.
    You have a multipage UserForm you're trying to open. Not a regular one as in the files I attached previously.
    To initialize a multipage UserForm you use
    Please Login or Register  to view this content.
    In addition, a lot of the initialize codes refer to sheet names that are not in your file.
    Userform3 refers to Sheet7, Userform 4 refers to Sheet8, Userform5 refers to Sheet9 etc etc.
    Last edited by jolivanes; 10-14-2015 at 01:29 AM.

  32. #32
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    i have solved that issued finally. my next issue is this,

    What i want to happen is this: when i click my get form button on my data input page it takes me to my "form selection Form" (which it is now doing), then when i select a form it goes to the relevant "continuation form"( which it is now doing), each sheet has its own continuation form, so I can add new data or continue to add to an existing student. what should happen is, i should be able to enter, the following format "student name/gender/grade" press submit then it takes me to the relevant input form with the first three text boxes (which would be student name, gender and grade already populated, along with the text box populated with all entry to the sheet to this point to address duplicates. this is the same concept you created for me with my "cautions" sheet

    Here's the thing, when I get to my continuation form, enter the data and click submit I get the following error, see attached VBAEG1 and VBAEG2. I also attached the workbook so you can see where i'm at to this point. can you please say why and how best to address this.

    Oh, as you have already probably figured out i am not very skilled at coding and am learning as a go so if i seem to be asking a lot of mundane questions, it is simply a testament to my ineptness re coding and not an attempt at being nagging lol!
    Attached Images Attached Images
    Attached Files Attached Files

  33. #33
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    You say that you've got it working up to a certain point.
    Your Workbook is so big because you have all kinds of Formats and Dropdowns to Row 1000.
    Delete Sheets not pertaining to your question and in the Sheet in question, delete entire Rows from Row 20 to past Row 1000 and save it as a file you can attach
    You also have 16 (!!!!) Userforms. Some 2 Page and some regular UserForms. Delete the ones not pertaining to your question.
    I don't know about other people but I am not going to try and find out which belongs to what.
    You have something in mind but the volunteers have to figure out what that is and you can't expect volunteers to spend hours on that.

  34. #34
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    You are 100% right sir and in hind sight I should have figured that out on my own. An apology is in order for this as to be blunt it now looks a bit inconsiderate. I will post a similar appology to forum vulunteers in the other post I made as well as i have no doubt many probably felt as you do.

    The drop boxes were from when I had resolved to input data straight to individual sheets, and the formatting down to 1000 was to facilitate the naming of that sheet to better facilitate vlookup. and the many userforms was the best way I could see to facilitate data input for my different data sheets ( which as later to be hidden) mimicking the macro you wrote for my cautions table. As I said previously I am a novice lol!

    in any event i have stripped every thing down to bare bones so persons will see what i was referring to without the excess headache. Than you for point out this inconvenience.


    I have attached a strip down version of the workbook devoid of the many sheets and userforms for easier consumption
    Attached Files Attached Files

  35. #35
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    When you start with the code, It is through the Button on a Sheet called "DATA INPUT FORMS" which is the Active Worksheet at that moment until another Sheet is made active.
    So all code that refers to specific sheets, other than the active Sheet which in this case is "DATA INPUT FORMS", need the name of the Sheet in it.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Now if you would leave the periods out like so
    Please Login or Register  to view this content.
    it will again refer to the active Sheet.

    A good way of testing is to have a Sheet with data in Column A to let's say A25 and in another Sheet with data in Colunn A to A10.
    If the data to A25 is called Sheet1 and the data to A10 is called Sheet2 you could run a trial code from Sheet1 like
    Please Login or Register  to view this content.
    See what your result is
    Now put the periods in place and run it again from Sheet1
    Please Login or Register  to view this content.
    Make sure all the references, Sheets, Ranges, Names etc are proper.
    See if there are any errors after referencing everything properly.

    In the original attachments, week and a half ago, the "continuation" Button was to have information for existing students appended.
    Not any more?

  36. #36
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Yes, I would like the option of to append or even edit data for an existing student within the system.

  37. #37
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    The code to append is in the attachment in Post #18.
    Editing is a brand new game again

  38. #38
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    So should I rewrite the code into my macro with relevant adjustments versus copying it over and making adjustments after it was copied?

  39. #39
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    You can certainly copy it. I think everybody does that, but you have to go through each line to make sure it references what it should reference.

  40. #40
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Good Day,

    I am attempting to incorporate what you have explained to me but i still getting errors messages. Debugging shows the line of code I modified as the culprit but I am not understanding why.
    Attached Images Attached Images

  41. #41
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Do you have a Sheet that is named "Sheet4"?

  42. #42
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Yes I do. If you look to the top left of the last image posted sheet 4 is the sheet named Student Info an is the sheet the data should go to

  43. #43
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    There is a difference between Sheet Names and Sheet Index numbers.
    Put this code in a Module and run it.
    Please Login or Register  to view this content.
    This might explain it.
    http://www.ozgrid.com/VBA/excel-vba-sheet-names.htm

  44. #44
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I created the module and inputted the code. It apparent gave each sheet an index number. So do I replace sheet4 in by example with the sheets corresponding index number# or should I enter the sheet in the order they are indexed, so instead of sheet4 I would put sheet1?
    Last edited by Pimp_mentality; 10-16-2015 at 04:09 PM.

  45. #45
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I FINALLY got this sheet to work, well partially, the data is now being sent to the correct work sheet (see attached the code I modified).

    the next issue is this when I get to the next form i don't see the first three text boxes populated with the info (as they were with the cautions macro you wrote. nor does any of the information I input in this sheet get sent to the student personal info sheet when I press submit, nor does the text boxes clear when I press cancel
    Attached Images Attached Images
    Last edited by Pimp_mentality; 10-16-2015 at 05:30 PM.

  46. #46
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    Did you go over the code that does work? You'll need to understand what the code does so you can use an adjusted version for other sheets/userforms/textboxes/listboxes.

  47. #47
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    Yes I think I do, so replicating for other sheets lie that one shouldn't be an issue. The next set of code associated with the next form, as explained is what is posing an issue now.

  48. #48
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    I was just looking at what you have but when you use the "continuation" button, do you need three types of info? That's the way you have it set up at the moment.
    I would think, and as you said yourself before, that one piece of relative info, either ID or Name, would be sufficient.
    If you go through the code from last week's attachment you'll see that that will search for a name in a column and append the data at the end of that row.

  49. #49
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    I have decided to go without id and use names. This macro allows me to address duplication as I can just select from the list. Yes one piece of info would be sufficient. But to be honest I just tried to follow the examples you gave and change the code accordingly. When I press the continuation button, ideally I would like for the form that pops up to be populated with all the info already inputted, so I would just fill in the blank text boxes. I honestly have no clue how to get that done, but I am just going one step at a time and hopefully I will be able to accomplish this

  50. #50
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    This is the code from last week's attachments that appends info.
    Please Login or Register  to view this content.

    In the attached Workbook you can add info, from the Personal Info UserForm Sheet only, to the Sheet with the "SUBMIT" Button.
    Attached Files Attached Files

  51. #51
    Forum Contributor
    Join Date
    10-03-2015
    Location
    Jamaica
    MS-Off Ver
    2013
    Posts
    120

    Re: Need help writing macro to input data in Different row each day: details inside

    good day,

    It is amazing that I am still struggling with this thing, with all the info I have read an all the help i have been given.

    I copied over the last macro you did for me and mad the requisite changes in the code re sheet references as well as changes in the module and I am still having problems see attached for a clearer view as to what debugging showed.

    This is puzzling to me as your original macro works fine. When I try to infuse it in my bigger project, problems . can you identify why I am having this issues
    Attached Images Attached Images

  52. #52
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Need help writing macro to input data in Different row each day: details inside

    What are the TextBox Names on your UserForm?
    TextBox1, TextBox2, TextBox3 etc etc without a space between "TextBox" and the number?
    Is your Sheet Name exactly the same? No difference in spaces between, in front or at the end? Spelling?

+ 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] Need to get counts by date for 2 columns (more details inside)
    By excelbrah in forum Excel General
    Replies: 9
    Last Post: 03-01-2015, 08:50 PM
  2. Replies: 12
    Last Post: 11-02-2014, 12:55 PM
  3. [SOLVED] Input data in one cell, copies row details to another tab
    By petelomax in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-26-2013, 04:11 AM
  4. Replies: 15
    Last Post: 07-15-2012, 02:27 PM
  5. Need help writing a macro involving user input!
    By Alkatraz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-22-2010, 05:38 AM
  6. Input box inside a macro
    By Drummy in forum Excel General
    Replies: 3
    Last Post: 06-07-2006, 05:49 AM
  7. putting an input box inside a macro
    By Drummy in forum Excel General
    Replies: 1
    Last Post: 06-07-2006, 03:15 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