+ Reply to Thread
Results 1 to 7 of 7

exporting data from a userform using listboxes

  1. #1
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    exporting data from a userform using listboxes

    I'm not sure if my title explains what I am trying to ask,

    I am attempting to write code to copy data from nonadjacent cells of one worksheet to a worksheet in a different workbook. I have written the code to copy and paste all of the data except one section of data that comes from a userform listbox. Two codes for the listbox are
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    The worksheet that is receiving the data is on the idea of a logbook. I have a column for each member and in each row I put a "1" in the cell if they were present and the cell is left blank if they were not. At the bottom of each column is a formula that calculates the percentage of calls present compared to the toltal number of calls.

    In the worksheet that will be sending the data, the names that are checked in the listbox are dumped into a merged range of cells with semicolons between them. I need to be able to paste a "1" for each name that is selected.
    If someone has an idea of how to do this, I would really apreciate the help.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: exporting data from a userform using listboxes

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Re: exporting data from a userform using listboxes

    Ok,

    Lets see if I can try this again. The uploaded file should contain two different files, a report form file and a log book file, they are both dummy files but the only differences from the originals are that I replaced real life names with Name 1, Name 2 etc.

    You will probably need to enable the macros to make the form work right, but maybe not. Rows 87-88 when selected, automatically pop-up a userform listbox with the names of all of the members. When a name is selected, and the userform closed, that name(s) is then put into the merged cells in rows 87-88.

    In the other file, you will see a simple log book and at the end of the row, there is a column for each member. What I want to do is to have a "1" added to the column under each persons name that was selected in the userform. I have other data that is copy/pasted into the logbook from the report form and so all I need is to figure out how to get the member data to copy and paste and then I will call the copy/paste code when running the save code so that when you click the save button at the bottom of the report form, it will all happen at the same time.

    I wondered if I need to somehow paste information from the userform into seperate cells in the report form (one for each member and hide them) and then run the same code that I use for the other data that is copy/pasted.

    I would appreciate any help that I can get

    Thanks in advance.
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: exporting data from a userform using listboxes

    Will both workbooks be open?

  5. #5
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Re: exporting data from a userform using listboxes

    Yes RoyUK,

    I will run the following code or something similar when saving to make sure that the logbook is also open.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Re: exporting data from a userform using listboxes

    Is it possible to do this or would I be better off populating a list in a different manner?

  7. #7
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Re: exporting data from a userform using listboxes

    Does anyone know a good way to make the data get to the logbook?

+ 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