+ Reply to Thread
Results 1 to 21 of 21

Data to Transfer in Sheet2

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Data to Transfer in Sheet2

    Hello,

    I need a vba code that will transfer data from Sheet1 to Sheet2 that has the data ?yes?. I just don?t know if it will be possible.
    Here is my scenario?.

    From Sheet1, I will be entering the item in A3:A25 and in H where I will put yes or no.

    I will probably be needing a macro button that will transfer the data that has ?yes? on in Sheet2 from A1:I1048576.

    Then, the next day it will be a new items. So I will clear the Sheet1 to start with a new item A3:A25. Once all the new item entered then I will click the macro button to transfer with ?yes? only in Sheet2 where it should go to the last entry. All the entry that was transferred in Sheet2 will stay remain and new entry should go in the last entry previous the transfer.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Data to Transfer in Sheet2

    Hi, RJ1969. Try with:

    PHP Code: 
    Sub Macro8()
    Dim ai&
    With Sheets("Sheet1")
      
    With .Range("I3", .Cells(Rows.Count"I").End(xlUp))
        
    = .Worksheet.Evaluate(Replace("Transpose(If(| = ""YES"", Row(|)))""|", .Address))
        
    Filter(aFalseFalse)
        If 
    UBound(a) < 0 Then Exit Sub
      End With
      
    For 0 To UBound(a): a(i) = Replace("A|:I|""|"a(i)): Next
      
    .Range(Join(a",")).Copy Sheets("Sheet2").Cells(Rows.Count1).End(xlUp)(2)
    End With
    End Sub 
    Last edited by beyond Excel; 03-22-2023 at 11:27 PM.
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Data to Transfer in Sheet2

    Another Option
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Thank you both!!!

  5. #5
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Hi beyondExcel,

    Instead of A moved to B. My item was moved to B column.

    Thanks

  6. #6
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Here is the worksheet I have revised. Can you fix it please.
    I added a Sheet2 and adjust the columns. Both "yes" should go to Sheet3.

    Sheet1 macro 8 and Sheet2 is macro9.

    Can you please add a comment in the vba code what need to change for the future reference. Just in case if I need to adjust.

    Thank you in advance!
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Data to Transfer in Sheet2

    It is enough that you use a single macro.

    I've changed the name of the sheet receiving the copy to 'Destination':

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Hello

    Thank you.... I will try it right now.

    Let you know.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Data to Transfer in Sheet2

    Please Login or Register  to view this content.
    OR

    Please Login or Register  to view this content.
    Last edited by sintek; 03-24-2023 at 07:39 AM.

  10. #10
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    BeyondExcel,

    I have a conditional format or other format settings like the color font, color cells in an "activesheet" but when I transfer to "Destination" it also copied the format what's on the activesheet. In the "Destination" I just want the value to be copied. The "destination" worksheet has its own format like column size, font size and so on.

    Thank you

    Please Login or Register  to view this content.

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Data to Transfer in Sheet2

    Just chopped liver...I guess I am...

  12. #12
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Data to Transfer in Sheet2

    Quote Originally Posted by RJ1969 View Post
    BeyondExcel,

    I have a conditional format or other format settings like the color font, color cells in an "activesheet" but when I transfer to "Destination" it also copied the format what's on the activesheet. In the "Destination" I just want the value to be copied. The "destination" worksheet has its own format like column size, font size and so on.

    Thank you
    Let's go with another version:

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    BeyondExcel

    Thank you. It did work.

  14. #14
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Sintek
    I want to say "Thank you" to you too. I did try yours as well.

  15. #15
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    BeyondExcel,

    What do i need to change for "Destination" range. I want to start in B4 instead of B2.

    on this code? I tried to change (xlUp)(2) to (xlUp)(4) but it skip 1 row.

    Please Login or Register  to view this content.

    Thank you.
    Please Login or Register  to view this content.

  16. #16
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Data to Transfer in Sheet2

    Quote Originally Posted by RJ1969 View Post
    BeyondExcel, What do i need to change for "Destination" range.
    I want to start in B4 instead of B2. on this code?
    Nothing... You don't have to change anything!

  17. #17
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Oh ok.
    When I click the button from sheet1 to “destination” it started in row2. I wanted to start in row4 so that i can put something on top of row4.

    Thank you

  18. #18
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Data to Transfer in Sheet2

    I want to start in B4 instead of B2.
    Change red snippet below to
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  19. #19
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Data to Transfer in Sheet2

    Quote Originally Posted by RJ1969 View Post
    Oh ok.
    When I click the button from sheet1 to “destination” it started in row2. I wanted to start in row4 so that i can put something on top of row4.
    Who defines where the data begins is the title row of the data range (in this case in the Destination sheet).

    Make sure the titles are present on the sheet then.

  20. #20
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Good morning ExcelBeyond

    My worksheets are protected cells so I added a code to unlock and lock the worksheet.

    The code you provided will work with several sheets (Sheet1 and Sheet2) to move the data in the “Destination” sheet.

    Adding the unlock/lock code, I know that Sheet1 should be replace in order to work in accordance to the code you provided. Should I add sheet2 to it?

    i.e. Sheets("Sheet1,Sheet2").Unprotect?

    To unlock the worksheet is code 1234.

    Please advised.

    Thank you

    Please Login or Register  to view this content.
    Attached Files Attached Files

  21. #21
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Data to Transfer in Sheet2

    Hi

    I am getting an error '1004' when I click the button in Sheet1 and Sheet2.

    Can you help me fix it.

    Thank you
    Attached Files Attached Files

+ 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. VBA code to Transfer specific data from sheet1 to Sheet2
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2017, 09:37 AM
  2. Can Excel transfer data From sheet1 to Sheet2?
    By BM2006 in forum Excel General
    Replies: 5
    Last Post: 03-25-2016, 04:55 AM
  3. Transfer Data from Sheet1 to Sheet2
    By smilan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-23-2015, 03:52 PM
  4. auto transfer data to sheet2
    By patupat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2012, 08:09 AM
  5. I want to transfer data from SHEET1 to SHEET2
    By hesham63 in forum Excel General
    Replies: 4
    Last Post: 07-30-2011, 12:28 PM
  6. Transfer data from sheet1 to sheet2 and sheet3
    By vbosmiya in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-21-2007, 11:42 PM
  7. Transfer data from sheet1 to sheet2
    By Tommy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2005, 02:06 PM

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