+ Reply to Thread
Results 1 to 2 of 2

Formulas in Userforms

Hybrid View

  1. #1
    Registered User
    Join Date
    09-28-2013
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Formulas in Userforms

    Lets see if I can explain this correctly.

    I am very new to the world of VBA etc, I have worked with spreadsheets for a while now and have never had to look into the more advanced side of things but I took on this project and now I seem to be stuck. I have almost the end product but stuck with the following.

    I am in the middle of creating a spreadsheet allocating times for people to attend my office. The day they attend will be determined by the last two digits of their national insurance number. I have made my userform for the information I need to record and put into the spreadsheet (National Insurance Number (NINO for short), Surname, Initials, Date of first contact, Date of Birth). (For those of you who are outside the UK National Insurance Number format is as follows: AB123456A). If the last two digits of their NINO are even then it will be week 1, if they are odd it will be week 2. The day of the week is decided as follows:
    Monday - 00 - 19, Tuesday - 20 - 39, Wednesday - 40 - 59, Thursday - 60 - 79 and Friday - 80 - 99.
    I have the formula on a separate sheet which works this out as follows:
    =MID(cell where NINO is input,7,2)+0 - lets the next line know what the last two digits are
    =IF(A15>79,"FRI",IF(A15>59,"THU",IF(A15>39,"WED",IF(A15>19,"TUE", "MON")))) - this determines the day (A15 being the cell where the above formula is being stored at the moment)
    =IF(MOD(A15,2), "1", "2") determines the week.
    This determined then I have to make a timeslot for 4 different people.
    What I need is some way of putting the above formulas into my userform so that when I input peoples data as required once I click on the submit button, it gives the next available timeslot to either person 1, 2, 3 or 4. This can be done automatically but I would prefer to select either 1, 2, 3 or 4 to even out the number of people each of my people see.

    Or if there is another way of doing this, I am open to offers!! sensible ones of course.

    Can anyone help please?????
    Last edited by raybot; 09-29-2013 at 09:20 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,268

    Re: Formulas in Userforms

    Presumably you are using a textbox to input the NINO?

    If so, you could use the Exit event to do the calculation and populate the other fields.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Help with vba for userforms
    By GhostCookie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2013, 09:54 PM
  2. [SOLVED] Excel 2007 : UserForms
    By nlm in forum Excel General
    Replies: 1
    Last Post: 06-17-2012, 12:39 PM
  3. Userforms - 2 formulas not working together
    By ssdsibes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-16-2009, 05:53 AM
  4. Userforms
    By carlito_1985 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2005, 04:04 AM
  5. userforms
    By john.9.williams@bt.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2005, 10:06 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