data addition to excel filtered by comboboxes

  • Hello!


    On 1st form, user selects day, month and colour (with comboboxes). On 2nd form, user writes cost, prize, entries, received and %. Then click on Save.
    This data will go to an Excel worksheet template which has 3 tabs (red, green, blue).
    What I need is a code so when I select on 1st form "2016", "may" and"colour blue" --> data will save in the 3rd tab (blue) and in the respective cell.


    thanks very much!


    here is an example
    forum.ozgrid.com/index.php?attachment/68735/

  • Re: data addition to excel filtered by comboboxes


    I changed around your code and form for testing purposes, however, this should point you in the direction your looking for.


    I attached your sheet back so you can see the changes I made to UserForm1 -> What I did in Frame1 you should be able to implement in UserForm2


    Good Luck..


    [ATTACH=CONFIG]68736[/ATTACH]


  • Re: data addition to excel filtered by comboboxes


    Fuzz-Head, that's exactly what I was looking for!! thanks for your time!


    Even your design gives me more things to learn and apply.


    Thank you SO much!



    *EDIT:


    if you don't mind, could you explain me what does these lines do?


    Code
    For lCol = 2 To .Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column           
     GoTo Jump
    Jump:
    TextBox1.Value = vbNullString


    which is the difference between vbNullString and "" or 0?


    thanks again sir!

  • Re: data addition to excel filtered by comboboxes



    Based on your example, I saw any date data starts on the second column so that is why you see 2
    the .cells.find statement allows me to search the far most right column within your sheet


    goto jump is what I sometimes do when I want to jump over looking at something, so in this case, if the wroksheet was the not a sheet I want to view, then I jumped over it.


    vbnullstring simply erases the data someone inputed leaving it blank for the next time it is to be used.


    Hope this helps. Glad it worked for you..

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!