Results 1 to 17 of 17

Copy cells from one worksheet to another while skipping blanks

Threaded View

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

    Copy cells from one worksheet to another while skipping blanks

    Hi. I hope you all can help me. I have this code that will copy cells while skipping blanks, but it drops everything into column A. I need it to go across multiple columns.

    I need it to copy a larger range.

    I have a range (CZ9:DD34 & CZ363:DD365) on a worksheet called K-5 (5 Week FV Bar).

    I want it to copy the cells but skip blanks. I want it to copy to this range (A8:E33) on worksheet K-5 (5 Week FV Bar) PR.

    My macro is below, but when I run it, it gives me run-time error of 13, "Type mismatch".

    Please help. Thanks in advance.

    Here's an example of what I need.

    table.jpg


    Sub Copy_Recipes_PRW1Monday()
    Dim cell As Range, r As Long
    r = 8
    Application.ScreenUpdating = False
    Sheets("K-5 (5 Week FV Bar) PR").Range("A8:E33").ClearContents
    For Each cell In Sheets("K-5 (5 Week FV Bar)").Range("CZ9:DD34, CZ363:DD365")
    If Len(cell) > 0 Then
    Sheets("K-5 (5 Week FV Bar) PR").Range("A" & r).Value = cell.Value
    r = r + 1
    End If
    Next cell
    Application.ScreenUpdating = True
    End Sub
    Last edited by gawk1980; 02-23-2013 at 08:41 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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