+ Reply to Thread
Results 1 to 9 of 9

Loop to transfer a row of values to another sheet based on value on one Cell

  1. #1
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    48

    Loop to transfer a row of values to another sheet based on value on one Cell

    Hi everyone,

    I'm trying to transfer the corresponding data from one row to another sheet, based on the chosen value in one cell in the destination range. I have attached a sample workbook explaining this. Thank you very much!
    Attached Files Attached Files
    Last edited by realbestpete; 05-02-2019 at 03:18 AM.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    48

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    Thank you very much jolivanes, it didn't transfer the date to D8 in the "ToSheet", which was the first cell in the destination range but thanks to your help, with the first part of your code: rw = Sheets("FromSheet").Columns(1).Find(Sheets("ToSheet").Range("G7").Value, , , 1).Row, which was the part I was missing to find the row in "FromSheet", I managed to use the rest of the code I had!

  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,903

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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

  5. #5
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    48

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    Yes, sorry alansidman, I forgot that!
    Last edited by realbestpete; 05-01-2019 at 11:36 PM.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    I know you marked it solved but this might be slightly faster and has the date transfer in it.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    48

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    Thank you jolivanes, I appreciate your good will and extra help, and in fact, the code I ended up using is the one of your Maybe_A macro because although I have to admit that I preferred the one I had, given that it adapted itself to any named range as opposed to having to modify the column number in With sh1.Cells(i, 5) and the cell reference for the date With sh1.Range("D8"), I placed the one I had it under the Private Sub Worksheet_Change(ByVal Target As Range) with the conditional If Target.Address = "$G$7" Then, but it got an error while Maybe_A ran smoothly there. Just in case you want to have a look at it and perhaps find what it is that doesn't let it run under Private Sub Worksheet_Change(ByVal Target As Range);

    Please Login or Register  to view this content.
    Last edited by alansidman; 05-02-2019 at 05:06 AM.

  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,903

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

  9. #9
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    48

    Re: Loop to transfer a row of values to another sheet based on value on one Cell

    Sorry again alansidman, I have read the rules now!

+ 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. Transfer data from one sheet based off cell value
    By bpsaunders04 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-27-2018, 06:58 PM
  2. transfer data from one sheet to another based on a cell
    By salmasaied in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-12-2018, 12:20 AM
  3. [SOLVED] Transfer Cell Data From 1 Sheet To Another Based on Criteria
    By thecircularwriter in forum Excel General
    Replies: 10
    Last Post: 01-24-2016, 04:46 PM
  4. Transfer Cell Values from One Sheet to another based on Week Value
    By markusvirus in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-11-2016, 11:35 AM
  5. Transfer cell value from sheet to sheet based on user input (SOLVED)
    By Terrydorset in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-18-2013, 01:28 PM
  6. [SOLVED] Macro to transfer data as values to another sheet based on the result from a formula
    By bpiroma in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2012, 07:22 AM
  7. [SOLVED] Transfer cell values to another sheet, but need to skip duplicates
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-04-2012, 06:20 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