View Single Post
 
Old 09-20-2024, 09:32 AM
NoSparks NoSparks is offline Windows 10 Office 2010
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

try this and move Next term down below it
Code:
'*******************************************************************
'Code from here down to next line of asterisks

    For Each cell In wsSource.Range("B2:B" & lastRow)
       If cell.Value = "" Then
          Exit For
       Else
          If cell.Offset(, 2) = wsDest.Name Then
            Sheets(cell.Value).UsedRange.Copy
            wsDest.Range("A" & wsDest.UsedRange.Rows.Count + 2).PasteSpecial Paste:=xlPasteValues
          End If
       End If
    Next cell

'Code from here up to next line of asterisks
 '*******************************************************************
Reply With Quote