+ Reply to Thread
Results 1 to 13 of 13

copy datal to another worksheet once an option is selected

  1. #1
    Registered User
    Join Date
    02-23-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Unhappy copy datal to another worksheet once an option is selected

    Hi,

    Please help me with the following action:

    On Worksheet A, when "Accept" is selected from the option list of field "Offer", data from the field "Student ID" of the same row in the same Worksheet will be copied to a NEW line on Worksheet B under the field "Student Number".

    Thanks for your help.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy datal to another worksheet once an option is selected

    What are the column numbers for Offer and Student ID?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    02-23-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: copy datal to another worksheet once an option is selected

    Hi, thanks for helping. The column for "Offer" is AD column for Student ID is C on Worksheet A; and the column for Student Number is A on Worksheet B.

    Await your advice,

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy datal to another worksheet once an option is selected

    Do you want this to be instant? As soon as you select the value in the dropdown, the row should be copied? But what if the user selects the dropdown twice? The copy will happen twice. Why not have a button in this case? Select all the dropdown values and then click the button for the copy to happen.

  5. #5
    Registered User
    Join Date
    02-23-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: copy datal to another worksheet once an option is selected

    This is an excellent idea. I agree to add a button to copy. By the way, it does not copy the entire row, it just copies data in the same row under column C.

    Thanks for your help. Again await your prompt advice,

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy datal to another worksheet once an option is selected

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  7. #7
    Registered User
    Join Date
    02-23-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: copy datal to another worksheet once an option is selected

    Hi,

    I have tried and it worked. Thanks a million - you saved my life.

    There is only one more requirement - can the Student ID from Worksheet A be copied to the bottom of the list in Column A of Worksheet B instead of inserting in Column A by numeric order?

    Also, I will try to add a button which incorporates your macro instead of asking the users to follow the steps.

    Thanks and await your advice,

  8. #8
    Registered User
    Join Date
    02-23-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: copy datal to another worksheet once an option is selected

    Hi,

    I got problems with your Macro. It worked perfect until an hour ago. Instead of copying the data under Column A in Worksheet A, it copied data under Column C. Please help .

    Thanks and await your prompt response.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy datal to another worksheet once an option is selected

    You said in post 3 that
    The column for "Offer" is AD column for Student ID is C on Worksheet A; and the column for Student Number is A on Worksheet B.
    So thats why it copies data from C of worksheet A to A of worksheet B.

    It does not copy it in numerical order, unless you have a sort code elsewhere in your file. It copies it to the next available row.

  10. #10
    Registered User
    Join Date
    02-23-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: copy datal to another worksheet once an option is selected

    Hi,

    Thanks for your prompt reply. I have changed from column C to column A in your script. But it still did not work. I have attached screenshots for your information.

    Thanks
    Attached Files Attached Files

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy datal to another worksheet once an option is selected

    When you say it does not work, are you getting any error?

  12. #12
    Registered User
    Join Date
    02-23-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: copy datal to another worksheet once an option is selected

    I did not get any error messages. As per my screenshots sent, instead of copying the correct data (which is the student ID), wrong data (country) was copied.

  13. #13
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy datal to another worksheet once an option is selected

    Ok, so once you changed it to A from C, did it work properly?

+ 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