+ Reply to Thread
Results 1 to 4 of 4

Writing Data From Form to Cells in Worksheet

  1. #1
    Registered User
    Join Date
    05-04-2007
    Posts
    28

    Writing Data From Form to Cells in Worksheet

    Hi,

    I have a userform which contains 3 list boxes and 2 text entry fields, where the user will enter a date in each in format ddmmyy.

    The form has a submit button at the bottom.

    What code do i need on the submit button to be able to write the values in the list boxes and the text (date) fields into a set of cells in one of the worksheets once clicked, also closing the form once clicked and leaving the selections in the relevant cells?

    E.g. I want listbox1 selection in cell B10 and listbox2 in B11, listbox3 in B12 etc etc.

    Thanks in advance for any help.
    Dan

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Hello Dan,

    I will normally have my button call a subroutine

    Please Login or Register  to view this content.
    To get the information from your ListBoxes the format is

    UserFormName.ListBoxName.Value

    To close the form AFTER you have gotten your data

    Please Login or Register  to view this content.
    Here is an example from a program I have

    Please Login or Register  to view this content.
    Hope this will help get you started.
    Sincerely,
    Jeff

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon DanSherwood

    ...and welcome to the forum!

    This question pops up from time to time. Have a look at my answer to this thread which has a sample file attached, complete with commented code.

    http://www.excelforum.com/showthread.php?t=598142

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  4. #4
    Registered User
    Join Date
    05-04-2007
    Posts
    28

    Forms to Cells

    Thanks both, I have managed it now thanks to your help. Much appreciated.

+ 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