+ Reply to Thread
Results 1 to 28 of 28

How to move data from one sheet to another

  1. #1
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    How to move data from one sheet to another

    Hi ,I have an excel spreadsheet,I have a problem and I need a macro , in sheet1 I have several values of 7 numbers in a cell, example 1|2|3|4|5|6|7| up to 93|94|95|96|97|98|99|, which can be found on the columns A, B, C, D, E, F, G, H, I, and I want for example to extract all values that begin with the number 1 ,and to put all the values in the worksheet 2 columns A, B, C, D, E, F, G, H, I,, for example 1|2|3|4|5|6|7| ,,,,,, up to 1|94|95|96|97|98|99| moved in sheet2 from sheet1.
    I tried to extract the filter from the data tab .... sort and filter,,, filter,,,, filter by number,,,, starting with,,,, we apply the filter, but when we selected data values and take that were among the selected what was not good.


    will explain more fully,I like this column A 1|2|3|4|5|6|7| , 21|25|32|43|51|60|73|, 1|2|3|4|52|69|78| ,11|12|30|45|50|61|79| ,3|5|70|74|75|77|79| , 1|22|33|44|50|63|75|, 1|22|33|44|50|63|75|................ column B 1|2|3|4|5|6|23| , 1|2|3|4|5|6|8| , 1|2|3|4|5|6|9| , 1|2|3|4|5|6|10| , 11|21|31|40|52|61|70| , 9|2|3|4|50|68|70| , 1|12|13|24|51|60|77| ,......... column C 1|2|3|4|50|65|70| , 2|5|7|9|10|16|37| ,5|8|9|14|15|26|67|,,,,,,,,,,,1|94|95|96|97|98|99|. In these columns I want to extract all values that begin with nr1 .....1|2|3|4|5|6|7|,,,1|90|91|92|93|94|95| from sheet1 in the sheet2,
    I mean these... column A 1|2|3|4|5|6|7| ,1|2|3|4|52|69|78| ,1|22|33|44|50|63|75| ,1|20|31|43|55|60|71|
    column B 1|2|3|4|5|6|23| , 1|2|3|4|5|6|8| , 1|2|3|4|5|6|9| , 1|2|3|4|5|6|10| ,1|12|13|24|51|60|77| column C 1|2|3|4|50|65|70| , 1|94|95|96|97|98|99|
    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    You will need to explain the logic of consolidating the values. Your current explanation is not clear what you want to happen. Perhaps in your spreadsheet, you can show an example of what the results should look like on Sheet2 and why.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    I want the values that begin with the No. 1, the move from sheet 1, in sheet 2, then put in order the No. 1 in another sheet to see double values,
    I have several files that you need to extract the values that begin with the # 1

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    Let me make sure I understand. Review all cells in Sheet1. If they begin with the number 1, copy that cell to Sheet2. All cells copied from Sheet1 should go into Column A of Sheet2 so that they can be evaluated for duplicates. Is this correct?

  5. #5
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    can also be on other columns, column A, column B, C, D, E, F, G, H, and I

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    This code puts all of them in Column A.

    Please Login or Register  to view this content.
    If they are in Column A in Sheet 1, should it be pasted to Column A in Sheet2 and likewise for column B in Sheet1 pasted to Column B in sheet2? etc.

  7. #7
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    or just column A

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    Does what I gave you work, or do we need to tweak it?

  9. #9
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    THANK YOU very much, WORKS, and if I want to do the same for another value to say those that begin with nr 7, what should I do, what change in code??

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    Change this line

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    ok, thank you very much for helping

  12. #12
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    they can makes the macro code to get the values of the sheet1 put them in sheet 2, not to remain in sheet1,delete the values in sheet1

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    Instead of copying the values to sheet 2, you would prefer that they be cut and pasted? Is this true?

    If that is the case, then try this:

    Please Login or Register  to view this content.
    It is just a matter of changing the copy command to cut.

  14. #14
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    I'd also like this version, cut and pasted

  15. #15
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    I know, as I have asked too much, I have only one request, I chose to take only those that begin with # 1, but among them I got the ones that begin with # 15, can anything be done to get it.Thanks

  16. #16
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    Think I got it figured:

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    is good, thanks

  18. #18
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  19. #19
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    Hello, please help me with a code macro
    I made some changes in the code, I mean I wanted to just one run to execute and run for other values, not just one, and it does not work, when I run the code only works when the mouse cursor is, not and other codes for other values, I would like to just one run commands to work all the codes for the values chosen by me

    Thanks so much
    Attached Files Attached Files
    Last edited by maximbebi; 02-13-2014 at 01:57 PM.

  20. #20
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    so I understand better, I want to run one command execution of the code, to move cut/paste all values that begin with the number 1,with 2,with 3,with 4 , with 5,,,,,,,, up to 77, to move them into a separate worksheet for each value,to take on value go hard,that is to look for values that begin with the first 1 then 2,,,,,,
    Last edited by maximbebi; 02-13-2014 at 02:34 PM.

  21. #21
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    Maxim;

    I changed it up a little. First you had changed the order of the sheets by adding a Page 0 that was not taken into account in the code. That was where your issue was. Now that I see that you will be using up to 90+ sheets, I changed the code. I now added a input box that asks what number you wish to analyze. Your response will cut all those from Column A (which I noticed is where all the data is now-- will this remain or will you use out to column I? If you will use out to column I as previously you will have to change this line of code
    Please Login or Register  to view this content.
    ), and put them in the appropriate page.

    Test




    Please Login or Register  to view this content.

  22. #22
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    Hello,
    the code that you put him last night work is good, but not as I wanted, I modified the maxim1 file attached to how I want to work, if you look at the code in the vba code, the same code is modified more than once for each number and sheet ,the first is for values that begin with # 1 and transfer in sheet 1, then is the code for no. 2 who transferred into the sheet 2, then the code for the No 3 transfer no. 3 in sheet 3, and so forth, with 4,5,6, 7.....
    I did so in my opinion, when I run the all codes, to work and to transfer all values in spreadsheets that need, but not all the codes work, but worked only one single , which is not good.

    How do I work the code!
    So I understand,Suppose I have the correct code, and get into macros and give execution,
    that code move all values in the sheets0 columnA (values that begin with 1 ,with 2,with 3 to 77)in sheets 1,2,3,4,,,,, up to the sheet77, meaning no.1 is moving to sheet 1, nr 2 in the sheet 2, no. 3 in the sheet 3, and so on up to no. 77 in the sheet77, meaning all the values from the sheet 0 in the sheets for each number in part, a single code execution.
    Thanks so much.
    Attached Files Attached Files

  23. #23
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    So you are looking to run 77 different macros? That seems to me to be a little bit over the top, but it is your spreadsheet.

    If I understand correctly, this works if the number is a single digit. If it is larger then you need to change this line

    Please Login or Register  to view this content.
    for example if 15 is what you want to check then it would look like this

    Please Login or Register  to view this content.
    You have to adjust the left function for the number of characters you are looking to find..

    I hope this solves your issue, but I do like my last code better than having 77 different macros.

  24. #24
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    So you are looking to run 77 different macros?

    Yes, I want to run 77 different macros a single execution

  25. #25
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    A single code to move all values in the sheets0 columnA (values that begin with 1 ,with 2,with 3 to 77)in sheets 1,2,3,4,,,,, up to the sheet77, meaning no.1 is moving to sheet 1, nr 2 in the sheet 2, no. 3 in the sheet 3, and so on up to no. 77 in the sheet77, all the values from the sheet 0 in the sheets for each number in part, a single code execution.

  26. #26
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    Okay. We are on the same page now. This should do exactly what you are looking for.

    Please Login or Register  to view this content.

  27. #27
    Registered User
    Join Date
    02-12-2014
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to move data from one sheet to another

    Yes so I wanted , is good work.

    Thank you so very much for all the help given.

  28. #28
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: How to move data from one sheet to another

    You are welcome.

+ 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. [SOLVED] Move coulumns data of a sheet to diff other columns of other sheet in same workbook
    By ROHAN999 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-03-2013, 09:22 AM
  2. Replies: 2
    Last Post: 05-27-2013, 11:21 PM
  3. Split Data Unique Value From 2 Sheet of A column and Move to 2 Sheet with Splited Values
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2013, 04:21 AM
  4. Move entire row of data from Sheet 1 to sheet 2 when completed date is entered.
    By jt7721 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2013, 11:50 AM
  5. [SOLVED] Move rows of data from one sheet to another based on specific values of sheet
    By buntalan80 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-26-2013, 06:21 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