Results 1 to 2 of 2

Loop through a range pasting in Blank Cells

Threaded View

  1. #1
    Registered User
    Join Date
    05-21-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Loop through a range pasting in Blank Cells

    I have a macro that will copy and paste to the next blank cell, but I need it to loop through the entire worksheet, with the condition that it skips the header rows in gray. In the attached sample worksheet I am tryting to copy E8:H8 to all blank cells to bottom, skipping row 21 & 24....etc. My macro copies and pastes correctly to Blank but i haven't figure out to make it loop and skip header properly.

    Sub CopyH8ToBlanks()
    
       Range("E8:H8").Activate
       Selection.Copy
    
       lMaxRows = Cells(Rows.Count, "E").End(xlUp).Row
       Range("E" & lMaxRows + 1).Select
       Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
          False, Transpose:=False
    
    End Sub
    Attached Files Attached Files
    Last edited by Richard Buttrey; 05-29-2011 at 01:22 PM. Reason: Adding code tags for new member

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