I have this code that copies an entire row (of a cell that matches "i1" in column "AA7:AA100") and pastes the entire row in the next available row starting with AA1....
But I DO NOT want it to copy an entire row, rather just between (AA:AQ) of the matching cell's row
Private Sub Worksheet_Activate()
Dim r As Range, x, c As Range
Set r = Range("AA7:AA100")
Application.ScreenUpdating = False
ActiveSheet.Rows.Hidden = False
For Each c In r
If c = Range("i1").Value Then
c.EntireRow.Copy = True
Application.ScreenUpdating = False
Dim TargWb As Workbook
Dim iRow As Long
Set TargWb = Workbooks("LITERATURE-CATALOG.xlsm")
With TargWb.Sheets("StatusAnnual")
iRow = WorksheetFunction.Max(1, .Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1)
.Cells(iRow, 27).PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
Application.ScreenUpdating = True
End If
Next c
Application.ScreenUpdating = True
End Sub
Bookmarks