Posts by itsvvvvera

    This is exactly what I'm looking for!! Thank you SOOOO much Roy for your generous help and time with me on this project. I'm aware that there are a lot of improvements to my code because most of them I learned step by step by watching different Youtube videoes. I will definitely check on your website and other forum post. Thanks for the advice!

    Hi Roy,


    Thanks for your msg. Please take a look at the first excel sheet "2C return" , then click "add new record" to open the data entry form. There is a text box with RMA number in there, and below you will find source (there are two purchasing platform: CMI & Amazon). I'm looking to create a sequence number for each individual purchase platform following my conditions listed above.


    Here is a bit more detail: the number that generated is continuous number, but only so when they fall into the same time period. Let's say when time goes from April to May, the RMA number would be like for example 2004-C006 to 2005-C001. Same principal apply when purchase platform is on Amazon, and then the only change would be letter "C" to "A" (ex.2005-A001).


    It sounds complicate and I know it might easier to just type in manually, but I'm just wondering if it is possible to do so with VBA?


    Thank you again for your time, and I'm waiting to hear back from you soon

    Hi everyone,


    I need to create a sequence number for customer return manage in my database. The sequence number should be written in Column A, with an order as below:

    -Start with the last two number of running year (example: 20 for 2020)

    -running month "04" for April, "05" for May and so on...

    -purchase platform "C" for CMI, "A" for Amazon (choose from user form)

    -and sequence number 001


    So for Amazon return it will be like: 2004-A001 and for the next Amazon return will be 2004-A002. Same for CMI return, it will be like" 2004-C001 and for the next company return will be 2004-C002.


    I have created the user form for all other data entry, but had no idea how to write code for this conditional sequence number. Any insights or feedback would be much appreciated.


    PS: I have attached my workbook here if you are interested to take a look at more details


    Thank you all in advance for your attention and helping hands!

    Thank you for your quick apply! This is how my code looks like now, and when I tried to add second data input, the record goes to the very last row of the spreadsheet (like row 991) instead of the second row A10.


    PS: I added & in between "E9" and Last_Raw because it keep saying compile error. Is it the reason cause the above situation?


    You should be using the variable Last_Row

    Code
    1. sh.Range("E" Last_Row).Value = Me.product.Value
    2. or
    3. sh.cells(Last_Row,5).Value = Me.product.Value


    You will need to amend all the lines.


    Take a look tat my free DataBase Form- link below in my signature

    Thank you! I did change all the lines based on your suggestion, and now I keep getting Run-time error"1004" msg saying application-defined or object -defined error for this code. How can I fix it?


    Code
    1. Last_Row = Cells(Rows.Count, "A9").End(X1Up).Row + 1

    Hello everyone,


    I'm new to VBA and recently just started learning on build a data entry form with VBA code. The problem I'm facing now is that my second data input won't goes to the next row, it keep overwriting my previous data input. I have checked other threads with similar questions but I just can't seem to get it to work. Any help would be appreciated! Thank you guys.


    PS: every data is designed to goes from row 9 (ex. A9, B9 ...) since I have a picture on the top.