+ Reply to Thread
Results 1 to 18 of 18

Add data through user form

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Add data through user form

    Hello Again,

    I am trying to add data from user form but i have issue while adding serial number in column A. VBA Macros showing error "Run-time error '13'. When i debug it is showing error on highlighted in red color on below code. Can anyone help me please.

    Showing Error In Line:

    Please Login or Register  to view this content.

    Full Code:
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Hi,

    Use below codes where the error is appearing.

    Please Login or Register  to view this content.
    Regards
    taps

  3. #3
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    Errro remains the same "Run-time error '13'.

  4. #4
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Hi,

    Error 13 is basically for data type mismatch.
    Therefore, check the bold part of below code whether it is generating or giving numeric values or not.

    Cells(lNextRow - 1, 1).Value + 1

    If the cell contains non numeric values then the above error will appear.

    Regards
    taps

  5. #5
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    I did not understand what you are trying to tell me.

    What i am trying to here is if i enter any record the serial number should generate automatically based on previous number. But it is giving error as i mentioned in post # 1 & 3

  6. #6
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Hi,

    Could you please attached the excel file?


    or try this..

    Please Login or Register  to view this content.
    Regards
    taps

  7. #7
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    Here you go. Please check the attachment. open file VB - form - save data button
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Dear Friend,

    Please apply my last formula. it is working successfully.

    Please Login or Register  to view this content.
    Regards
    taps

  9. #9
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    hai taps thanks for your help it is working now.

    I have another issue. I am try to add validation. If any field is empty of any of the checkox is not select then user should get a message for that particular field. Means if the user did not fill any information of leave the field blank then the message should appear. But it is not working for me any idea on this issue from your side.

  10. #10
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Hi,

    You can use codes like this..

    Please Login or Register  to view this content.
    for textboxes you can use codes like this..

    Please Login or Register  to view this content.
    Regards
    taps

  11. #11
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    Thanks for your reply if possible there is another issue i have tried but fail. I am trying to display a message if the textbox5 date is less than textbox3 date. Below is the code.

    Problem Is Here:
    Please Login or Register  to view this content.
    Full Code:

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Hi,

    Very small rectification is required. Instead of IsDate function use Cdate(...).


    Please Login or Register  to view this content.
    Note: If your problem has solved then please don't forget to mark it SOLVED.
    Also if there is any other issue except above then please create a new thread.

    Regards
    taps
    Last edited by taps; 11-23-2012 at 04:14 AM.

  13. #13
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    Thanks for your help Mr Taps. It works for me with small correction. I hope the below is the final issue from my side to close this topic.

    I have posted my script in post#1. I am looking for a value i.e. Visa No (Column B Values) in a active sheet only. I want to check the visa no complete workbook and display a message as below. For your suggestion and correction please.

    Here is the code:
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Hi,

    Not able to get your problem. Please let me know..
    1. Which sheet(s) contain visa number?
    2. Is it placed in entire column or in a particular cell?
    3. Where you would like to find the visa number? Only current sheet or entire workbook?
    4. What are the problem with current code you have mentioned above?
    5. How you wish to modify it?

    Regards
    taps

  15. #15
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    sorry for incomplete information. Here are the details.

    1. Visa number will be entered in column B on entire workbook.
    2. it is entered in column B i.e. let say visa no. 100 is entered in column B, can be in any cell but not more than one time. (Unique value)
    3. i want to find in entire workbook.
    4. my current code is looking in current sheet not complete workbook.
    5. in post # 1 i have provide you the complete script and post # 7 i have attached the file.

    I hope the above information is enough for your understand my problem.

  16. #16
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    Hi,

    Use below codes..

    Please Login or Register  to view this content.
    Regards
    taps

  17. #17
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Add data through user form

    Hai taps thanks for your time and help. I will marked this topic as closed if i have any issue i will come back to you with this thread.

    Topic marked as solved and reputation is added.

  18. #18
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Add data through user form

    You are most welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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