+ Reply to Thread
Results 1 to 4 of 4

Copy values until blank row

  1. #1
    Registered User
    Join Date
    11-21-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    11

    Copy values until blank row

    Hi again,
    I have been very successful in this forum when asking for help. So thanks in advance for the following.

    I have two sheets and I am copying values from sheet 1 to sheet 2. The values to copy are based on the column titles, row 6 in sheet 1 and row 2 in sheet 2.
    The formula I am using to populate sheet 1 is the following because sometimes the titles change places
    =INDIRECT(ADDRESS(ROW(E3),MATCH(E$6,Sheet2!$2:$2,0),,,"Sheet2"))

    The problem is that I have to copy down the formula manually. What I would like to have is some sort of VBA code that copies the values depending on the size of the columns in sheet 2. i.e. until it finds a blank row in sheet 2.

    Note: the code should be able to understand when the columns change the titles position, as it is doing now.

    sheet1
    sheet1.jpg

    sheet 2
    sheet2.jpg

    Thank you,
    Pedro
    Attached Images Attached Images
    Last edited by peetman; 02-27-2015 at 05:40 AM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy values until blank row

    Hi Pedro

    There's a rather large percentage of we Forum Members who are unable to view png files on this Forum. It's been an issue for some time now.

    Your best bet is to attach your File.

    (Attribution to Leith Roth)
    To help you with this problem, you need to post your workbook.

    This allows solutions to be tested using your code and not on code recreated based on your post.
    If your workbook contains any sensitive information, please redact that information before you post.

    How To Post Your Workbook
    • At the bottom right of the Reply window, Click the button Go Advanced
    • At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    • Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    • Click the Select Files button at the bottom middle of the dialog.
    • In the new window Find the file you want to upload, select it, and Click Open.
    • You will now be back in the File Manager dialog. Click the bottom Middle button Upload File
    .
    Wait until the file has completely uploaded before you exit the File Manager dialog.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    11-21-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    11

    Re: Copy values until blank row

    Quote Originally Posted by jaslake View Post
    Hi Pedro

    There's a rather large percentage of we Forum Members who are unable to view png files on this Forum. It's been an issue for some time now.

    Your best bet is to attach your File.

    (Attribution to Leith Roth)
    To help you with this problem, you need to post your workbook.

    This allows solutions to be tested using your code and not on code recreated based on your post.
    If your workbook contains any sensitive information, please redact that information before you post.

    How To Post Your Workbook
    • At the bottom right of the Reply window, Click the button Go Advanced
    • At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    • Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    • Click the Select Files button at the bottom middle of the dialog.
    • In the new window Find the file you want to upload, select it, and Click Open.
    • You will now be back in the File Manager dialog. Click the bottom Middle button Upload File
    .
    Wait until the file has completely uploaded before you exit the File Manager dialog.
    Hi,
    I have changed the pictures to .jpg format. Can you see it now?
    The workbooks contain quite sensitive information, that is why I will not share it. I will try my best to explain what I want.

    Thanks,
    Pedro

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy values until blank row

    Hi Pedro

    Yes, I can now see them...can't do anything with them.

+ 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. Copy Paste Values Only From One Sheet Into Next Blank Row
    By Biegs101 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2014, 01:52 PM
  2. How can I copy non blank values to another sheet
    By bongielondy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2013, 09:39 PM
  3. Copy values in to next blank row with a loop
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-12-2011, 09:59 AM
  4. Excel 2007 : Copy cells with non blank values.
    By enhydra in forum Excel General
    Replies: 2
    Last Post: 12-15-2009, 12:35 AM
  5. Copy then Paste Values to next blank row
    By joe90 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2008, 08:01 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