+ Reply to Thread
Results 1 to 5 of 5

Thread: Excel 2007. Macro to move data based on dropdown list.

  1. #1
    Registered User
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    91

    Excel 2007. Macro to move data based on dropdown list.

    Hi all,

    I have attached an example workbook (2007) of the solution I’m after. There are 3 sheets.

    In Sheet 1 - the user will enter numeric data in cells B2:J2 (highlighted in green). Then they would click the command button which would then enter this data into Sheet 2 into the appropriate row. The appropriate row is defined by whatever ‘Organisation’ they have chosen from the dropdown list on Sheet 1 (cell A2). In this example it is ‘Organisation 5’. Once the user clicks the command button I would like the data on Sheet 1 to vanish (and the dropdown list to revert to ‘Organisation 1’ so that they can continue to enter more data).

    The last part of this is that the user, at a later date, may be required to enter more and more data for Organisation 5 (for example). If this happens then I would like the data to be put below any previous data for that organisation (as shown in Sheet 3) – the new row is highlighted in orange.

    I need code for the command button which achieves the above - can anyone help please?
    Attached Files Attached Files
    Last edited by Plumby; 02-10-2012 at 09:52 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    214

    Re: Excel 2007. Macro to move data based on dropdown list.

    Hi
    I will, write something for you. Is it important that data appear in the order they were entered, or it is OK to add the new row at the bottom and sort the range by organization and date?
    Buran
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Excel 2007. Macro to move data based on dropdown list.

    Hello buran,

    Thank you. I think that would be fine, it doesn't matter in terms of how they are ordered as long as all the 'Organisation 5's are together, the 'Organisation 3's are together and so on and so on.

  4. #4
    Valued Forum Contributor
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    214

    Re: Excel 2007. Macro to move data based on dropdown list.

    Hi
    find attached file. macro is sheet1 module. I moved the list of organizations on separate sheet and defined a name for use in Data Validation for A2. I also set data validation for B2 cell (Date>01.01.2000).
    Attached Files Attached Files
    If you are pleased with a member's answer then use the Star icon to rate it.

  5. #5
    Registered User
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Excel 2007. Macro to move data based on dropdown list.

    Genius!! Thank you very much. Rep left.

+ 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.2.0