Thread
:
Compare 2 Lists and Take an Action Q
View Single Post
#
15
Posted to microsoft.public.excel.programming
Claus Busch
external usenet poster
Posts: 3,872
Compare 2 Lists and Take an Action Q
Hi Sean,
Am Mon, 21 Nov 2016 09:19:37 -0800 (PST) schrieb
:
Sheet3 will layout as follows
ColO should appear in ColA, starting at Row14
ColN should appear in ColB, starting at Row14
ColP should appear in ColH, starting at Row14
The twist on Sheet3 is that I have a certain layout, so if I I'm copyinfg in 60 rows of data, there needs to be 60 rows available starting at Row14 in Sheet13 if that makes sense, as I have a Subtotal Row currently on Sheet3 Row 29
I hope I understood your problem. At the moment you only have rows 14 to
28 available and if you have to inser more rows you first have to insert
empty rows?
Then try:
Sub ExtractUnmatched()
Dim myCnt As Long, LRow As Long
With Sheets("Reconciliation")
LRow = .Cells(.Rows.Count, "M").End(xlUp).Row
.Range("M1:Q" & LRow).AutoFilter Field:=5, Criteria1:="="
myCnt = Application.Subtotal(3, .Range("M:M")) - 1
If myCnt 14 Then Sheets("Sheet3").Rows(28).Resize(myCnt -
15).Insert
.Range("N2:N" & LRow).Copy
Sheets("Sheet3").Range("B14").PasteSpecial xlPasteValues
.Range("O2:O" & LRow).Copy
Sheets("Sheet3").Range("A14").PasteSpecial xlPasteValues
.Range("P2:P" & LRow).Copy
Sheets("Sheet3").Range("H14").PasteSpecial xlPasteValues
.AutoFilterMode = False
End With
End Sub
Regards
Claus B.
--
Windows10
Office 2016
Reply With Quote
Claus Busch
View Public Profile
Find all posts by Claus Busch