+ Reply to Thread
Results 1 to 7 of 7

Copy and paste row if a cell has a value

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Copy and paste row if a cell has a value

    Try This


    Sub CopyAndPaste()
    Application.ScreenUpdating = False
    
    Range("Y6:Y27") = Range("Y6:Y27").Value
    
    NR = 2
    Dim cell As Range
    With Sheets("Processor")
    
         For Each cell In .Range("Y6:Y" & .Range("Y" & Rows.Count).End(xlUp).Row)
         If cell.Value <> "" Then
             cell.EntireRow.Copy
             Sheets("Results").Range("A" & NR).PasteSpecial Paste:=xlPasteValues
             NR = NR + 1
             End If
        Next cell
     End With
     Application.CutCopyMode = False
     Application.ScreenUpdating = True
    
    End Sub
    Last edited by tuongtu3; 07-31-2013 at 09:13 PM.

+ 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. Replies: 6
    Last Post: 07-27-2013, 09:02 AM
  2. Replies: 8
    Last Post: 07-08-2013, 06:03 AM
  3. [SOLVED] Copy cell A1 and paste value into B1 if B1 has content, paste to B2...etc
    By mhopke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2012, 09:39 PM
  4. How to select cell C1, copy paste then C2, copy paste then C3 etc
    By s45yth in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2011, 07:15 AM
  5. Copy and Paste macro needs to paste to a changing cell reference
    By loulou in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2005, 07:06 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