+ Reply to Thread
Results 1 to 9 of 9

I create a user form but unable to edit saved data

  1. #1
    Spammer
    Join Date
    08-25-2016
    Location
    https://t.me/pump_upp
    MS-Off Ver
    office10
    Posts
    15

    I create a user form but unable to edit saved data

    hi all
    I create a user-form for record data for employee,s username and password. with add ,search, update and clear button. everything is working fine expect search button, for example , main concern is when i search data with number (1,2,3) i do update the saved data but when i search with word (ram, mahesh..)unable to do this
    please find the attachment

    please help me to resolve this


    thanks
    manish
    Attached Files Attached Files
    Last edited by manissinha5; 09-04-2016 at 01:09 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: I create a user form but unable to edit saved data

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Spammer
    Join Date
    08-25-2016
    Location
    https://t.me/pump_upp
    MS-Off Ver
    office10
    Posts
    15

    Re: I create a user form but unable to edit saved data

    I can search data with user "5" but unable to search with "ram"

    help please

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: I create a user form but unable to edit saved data

    That code was repeatedly searching to find if the TextBox0.Text was on the worksheet. And if so, where?
    Rather than repeating the same code in several locations, this version added a Function, CellsOfPerson that returns the range on the worksheet where the PersonName is found.
    Similarly, there is a RangeOfData function that returns the (expanding) range where the data is.
    Also, a Close button was added.

    The problem with the OP code was that the Update code was searching for Val(TextBox0.Text), which returns a number, frequently 0, rather than for the TextBox0 entry.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Spammer
    Join Date
    08-25-2016
    Location
    https://t.me/pump_upp
    MS-Off Ver
    office10
    Posts
    15

    Re: I create a user form but unable to edit saved data

    not working

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: I create a user form but unable to edit saved data

    How about now?
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: I create a user form but unable to edit saved data

    For reference this has been cross-posted here.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: I create a user form but unable to edit saved data

    Hello manissinha5,

    It was easier to rewrite your code than try to make what you had work. Here is the new code for UserForm1 and a macro Run display the user form.

    Try this out and let me know if this what you wanted. The attached workbook has all the changes.

    UserForm1 Code
    Please Login or Register  to view this content.
    Module1 Code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  9. #9
    Spammer
    Join Date
    08-25-2016
    Location
    https://t.me/pump_upp
    MS-Off Ver
    office10
    Posts
    15

    Re: I create a user form but unable to edit saved data

    thanks everyone for help me


+ 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. Unable to edit sheet after hiding User Form
    By seatbelts in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-23-2014, 09:16 AM
  2. Unable to transfer data from user form to spread sheet
    By katieshields in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2014, 05:43 AM
  3. Unable to create data form
    By rkauf in forum Excel General
    Replies: 1
    Last Post: 02-07-2014, 10:29 AM
  4. [SOLVED] create user form to collect data
    By donkey1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2013, 04:50 PM
  5. Replies: 3
    Last Post: 11-08-2012, 07:25 PM
  6. Edit Sheet1 data by using User Form Textbox
    By lapot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2012, 04:27 AM
  7. Replies: 3
    Last Post: 04-12-2012, 09:07 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