+ Reply to Thread
Results 1 to 13 of 13

Code Needed and Userform assistance

  1. #1
    Registered User
    Join Date
    12-06-2008
    Location
    UK
    Posts
    58

    Code Needed and Userform assistance

    Good Morning All,
    Firstly, I would like to say hello to everyone as you can see i am a new poster to this website and looking at it i may be a regular one due to the vast amount of knowledge available from all the regulars.

    Secondly, i have a problem

    I need to set up an excel spreadsheet for work that i need to have specifics. If i say what the specifics are is there any chance that someone could make one?

    The specifics are

    Column Titles : Surname / First Name / Date of Birth / Address / Date Spoken to / Notes / Photograph(if possible to attach)? / ABC Referal Yes or No

    I would like this all to be input form a UserForm as soon as the excel sheet is opened, meaning people put the correct information in. The Photograph ideally needs to be attached on the userform if this is possible? If this is not possible then a simple Yes/No option can be used for this column.

    I would also like if possible a Search option on the userform or a seperate search option on the sheet itself to be able to look for people with the same surname.

    (Now im probably being a pain but i would also really like.. When inputting information onto the userform, if someone enters for example, Bloggs, Joe, 02/01/90 and he is already recognised on the form that it flashes up and says (Check Log) I dont know if this is something that is possible)

    Each of the column titles on the Input form must be in a seperate text box, such as surname, first name dob etc.

    I have tried to set one up myself but get really stook when it comes to the Code to set it up, despite using websites to assist.

    I really do hope all you people can assist with my request?

    Kind Regards
    Mark
    Last edited by cruiser102; 12-06-2008 at 07:54 AM. Reason: Request

  2. #2
    Registered User
    Join Date
    12-04-2008
    Location
    Leeds
    Posts
    26
    Personally I think you'd be better off using MS Access for what your wanting and not excel!

  3. #3
    Registered User
    Join Date
    12-06-2008
    Location
    UK
    Posts
    58
    Thanks for that, however, unfortunately we dont have access at work, for some unknown reason....

    So it has to be excel unfortunately

  4. #4
    Registered User
    Join Date
    12-04-2008
    Location
    Leeds
    Posts
    26
    Quote Originally Posted by cruiser102 View Post
    Thanks for that, however, unfortunately we dont have access at work, for some unknown reason....

    So it has to be excel unfortunately
    Ah, shame!

    This maybe of some help then:

    http://www.contextures.com/xlUserForm01.html

    I'll try put something together for you now....I'm bored at work!
    Last edited by mobidv; 12-06-2008 at 07:42 AM.

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Your post does not comply with Rule 1 of our Forum Rules. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

  6. #6
    Registered User
    Join Date
    12-06-2008
    Location
    UK
    Posts
    58
    thanks mobidv. Much appreciated.

    Sorry about the post title, i noticed that in the rules but thought it meant like i had done it, I shall ammend now.

    Thanks

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    It's not code, but have you tried experimenting with the standard Data Form functionality that's in Excel. This allows you to add new records to a pre-existing list of data.

    If you really want to use a User Form, add a combobox or a text box to capture the input, then add some code to the AfterUpdate event. So for instance if your table of data has a range name "Data" and the combo/text box is meant to add a new entry to the first column in the Data table, use something like

    Please Login or Register  to view this content.
    For other comboboxes, just change the second element of the .Cells(1,1) code, to .Cells(1,2) or .Cells(1,3) etc.

    To detect duplicate names, one way would be to also have the combobox update a defined test cell, say above the list. Then adjacent to this cell use a COUNTIF() function to count the number of occurrences there are of the test cell in the relevant column of the data table. Then wrap the COUNTIF(() in and IF() function so that you have:

    Please Login or Register  to view this content.
    Hope this gives you some ideas

    Rgds

  8. #8
    Registered User
    Join Date
    12-04-2008
    Location
    Leeds
    Posts
    26
    Quote Originally Posted by cruiser102 View Post
    thanks mobidv. Much appreciated.

    Sorry about the post title, i noticed that in the rules but thought it meant like i had done it, I shall ammend now.

    Thanks
    No probs, have a try with this. There's no search function as i'm off out now and don't have time but that should give you a starting point.
    Attached Files Attached Files
    Last edited by mobidv; 12-06-2008 at 09:13 AM.

  9. #9
    Registered User
    Join Date
    12-06-2008
    Location
    UK
    Posts
    58
    Very good. This is basically what i am after... In fact it is exactley what i am after, Ideally the screen would load up as soon as the sheet is opened but i dont know if this is possible?

    If someone could point me in the right direction on how to add something such as an alert for a name if typed into the box this would be absolutley fantastic.

    Anyone?

    Regards
    Mark

  10. #10
    Registered User
    Join Date
    12-04-2008
    Location
    Leeds
    Posts
    26
    Quote Originally Posted by cruiser102 View Post
    If someone could point me in the right direction on how to add something such as an alert for a name if typed into the box this would be absolutley fantastic.

    Anyone?

    Regards
    Mark
    What sort of alert are you looking for? The current form will bring up an alert if a duplicate record exists (It checks first name surname and address)

  11. #11
    Registered User
    Join Date
    12-06-2008
    Location
    UK
    Posts
    58
    Ah, Sorry, i didnt check this.

    I have just tried it and it is great, however if i put two similar names in such as Joe Bloggs, although they may be a different date of birth it still picks it up as a duplicate record. It is often that people with the same name may be entered, but they will have a different date of birth.

    Kind regards
    Mark

  12. #12
    Registered User
    Join Date
    12-04-2008
    Location
    Leeds
    Posts
    26
    Quote Originally Posted by cruiser102 View Post
    Ah, Sorry, i didnt check this.

    I have just tried it and it is great, however if i put two similar names in such as Joe Bloggs, although they may be a different date of birth it still picks it up as a duplicate record. It is often that people with the same name may be entered, but they will have a different date of birth.

    Kind regards
    Mark
    Mark,

    Aslong as the two people both have a different address it should let you enter more than one with the same name.

  13. #13
    Registered User
    Join Date
    12-06-2008
    Location
    UK
    Posts
    58
    This document is great, I have ammended the userform slightly and wish to add another column to the document Team A or B as seen on the new userform.

    Couple more issues now though

    1. I cant get the options to be in the drop down menus such as yes/no and a/b

    2. When on the userform, if i press TAB to jump to a different box it goes from top to bottom box then back up, all in the wrong order.

    3. On the excel sheet with the button to open the userform, is there any way i can add a search tool on this screen where people can input a surname and date of birth to pull up the relevant person...?

    Thanks for all your help so far.

+ 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