Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-19-2020, 06:29 PM
jeffreybrown jeffreybrown is offline Copy Paste Special Loop to End of Col A Windows 10 Copy Paste Special Loop to End of Col A Office 2016
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Based on your description, I think this does what you need! Since there isn't a workbook example, I can only say it works on my test sheet and with your instructions.

Code:
Sub CopyPasteTranspose()
    Dim i       As Long
    Dim LastRow As Long
    Dim ws      As Worksheet: Set ws = Sheets("Sheet1") 'Change Worksheet to suit
    Application.ScreenUpdating = False
    With ws
        LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
        .Rows("1:1").Insert Shift:=xlDown
        .Range("H1").Value = "Hdr"
        .Range("H2:H" & .Range("A" & .Rows.Count).End(xlUp).Row).Formula = "=COUNTIF($A$2:A2,A2)"
        For i = 2 To LastRow Step 8
            .Range("A" & i).Resize(6).Copy
            .Range("B" & i).PasteSpecial xlPasteAll, , , Transpose:=True
        Next i
        With .Range("H1", .Range("H" & .Rows.Count).End(xlUp))
            .AutoFilter Field:=1, Criteria1:=">1", Criteria2:="0", Operator:=xlOr
            .Offset(1).EntireRow.Delete
            .AutoFilter
        End With
        .Rows("1:1").Delete Shift:=xlUp
        .Columns("H:H").EntireColumn.Delete
    End With
    Application.Goto [A1]
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub
Reply With Quote
 

Tags
copy paste special loop

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Paste Special Loop to End of Col A Loop through files and Copy Table Row and Paste into Different Document spiderman1369 Word VBA 2 10-15-2014 08:30 AM
Copy Paste Special Loop to End of Col A Paste Special: Copy and Paste Formatting Only? tinfanide Word 6 03-06-2013 12:21 AM
Copy Paste Special Loop to End of Col A DOCVARIABLE copy paste special cyndor Word 2 04-06-2012 03:57 AM
Copy Paste Special Loop to End of Col A special copy/paste iconofsin Excel 1 09-15-2010 12:10 AM
Copy Paste Special Loop to End of Col A Copy and paste special Dace Excel 2 02-16-2009 12:18 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:10 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft