Hi guys. I have really been struggling to figure out the issue here. The copy/paste works for the first part but not the second. Here's the code and I will explain the issue afterward:
Dim rgDel As Range
Set rgDel = sh2.Range(Range("A2"), Range("A2").End(xlToRight).End(xlDown))
Set rgDel = rgDel.Resize(rgDel.Rows.Count + 1, rgDel.Columns.Count).Offset(-1, 0)
'Filter and copy email scores
rgDel.AutoFilter _
Field:=8, Criteria1:=strE1
With rgDel
.Resize(.Rows.Count + 1, .Columns.Count - 1).Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy
End With
sh3.Range("A4").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
With rgDel
.Resize(.Rows.Count + 1, .Columns.Count - 1).Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy
End With
sh3.Range("A4").PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
'Filter and copy phone scores
rgDel.AutoFilter _
Field:=8, Criteria1:=strP1
With rgDel
.Resize(.Rows.Count + 1, .Columns.Count - 1).Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy
End With
sh3.Range("I4").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
With rgDel
.Resize(.Rows.Count + 1, .Columns.Count - 1).Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy
End With
sh3.Range("I4").PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
NOTE: sh2 and sh3 are worksheets. strE1 and strP1 are filter criteria entered earlier with an inputbox.
The issue is that the SECOND copy/paste does not work. It does filter so only the phone scores are showing but cannot seem to get the visible cells to copy/paste. Instead, the FIRST copied cells for email are just copied again to the second range. Please help.
Bookmarks