Results 1 to 4 of 4

Paste Range Loop

Threaded View

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    61

    Paste Range Loop

    Hi i have the following code to copy rows based on a cell reference

    However i cant seem to limit this range. i.e i need it to copy B:E if the row meets the pending criteria
    How do i make my code relative with regards to this.

    Furthermore, i get an error when pasting - cant seem to find the reason for this.

    Than you in advance!!

    Sub CopyDataFromSheet()
    
    Worksheets("input").Activate
    
    x = 8
    
    Do While Cells(x, 2) <> " "
    
    If Cells(x, 2) = "Pending" Then
    
    Worksheets("input").Rows(x).Copy
    Worksheets("Output").Activate
    
    RowCount = Worksheets("Output").Range("X" & Rows.Count).End(xlUp).Row + 1
    
    Worksheets("Output").Range("X" & RowCount).PasteSpecial xlValues
    Application.CutCopyMode = 0
    
    End If
    
    Worksheets("Input").Activate
    x = x + 1
    Loop
    
    
    End Sub
    Last edited by 2001jesper; 07-19-2013 at 11:10 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Cut and paste a Range, then loop
    By BenTeg in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-22-2012, 12:00 PM
  2. Loop through range names for location of dynamic paste
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-17-2011, 11:01 AM
  3. Setting a range within a loop variable for copy/paste
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2005, 12:10 PM
  4. [SOLVED] Setting a range within a loop variable for copy/paste
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2005, 06:25 PM
  5. [SOLVED] Loop through Range and Cut and Paste
    By Kevin L in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2005, 02:33 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