Results 1 to 3 of 3

Copy data from one sheet to another while skipping blanks and certain rows

Threaded View

  1. #1
    Registered User
    Join Date
    02-03-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2013
    Posts
    22

    Copy data from one sheet to another while skipping blanks and certain rows

    Hi. I'm trying to copy data from one sheet to another, but I want it to skip blanks and a row that has data on it. I've attached my spreadsheet that I need help on.

    I want o9:o12, o14:o17, o19:o22, o24:o27, and o29:o34 from Sheet1 to be moved to A8:A33 on Sheet 2. Those cells have a vlookup formula that makes the code below not work.

    Rows 13, 18, 23, and 28 on Sheet1 need to be left out.

    The data currently looks like this on Sheet1:
    Cinnamon Apple Slices


    Fresh Red Delicious Apple

    On Sheet2, I want the data to look like below with no spaces between each menu item.

    Cinnamon Apple Slices
    Fresh Red Delicious Apple

    Sub Copy_Stuff2()
    Application.ScreenUpdating = False
    Sheets("Sheet2").Range("A8:A33").ClearContents
    With Sheets("Sheet1").Range("o9:o12, o14:o17, o19:o22, o24:o27, and o29:o34").SpecialCells(xlCellTypeConstants)
    .Copy
    Sheets("Sheet2").Range("A8").PasteSpecial xlPasteValues
    'ClearContents 'Clear source data
    End With
    Application.CutCopyMode = True
    Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files
    Last edited by arlu1201; 02-15-2013 at 07:34 AM.

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