View Single Post
 
Old 03-14-2016, 07:32 AM
npalmer610 npalmer610 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Feb 2016
Posts: 5
npalmer610 is on a distinguished road
Default

Quote:
Originally Posted by Philb1 View Post
This will loop through the sheets and provided the worksheet isn't blank, will run your code
Cheers

Code:
Option Explicit

Sub CopytoLast()
Dim LastRow As Long, shtCount As Long, i As Long

shtCount = ThisWorkbook.Worksheets.Count

For i = 1 To shtCount
    If Not Application.WorksheetFunction.CountA(ThisWorkbook.Sheets(i).Cells) = 0 Then
        Columns("F").ClearContents
        LastRow = Cells(Rows.Count, "E").End(xlUp).Row
        Range("F2:F" & LastRow).Formula = "=CONCATENATE(A2,"" "", D2, "" "", E2)"
    End If
Next i

Exit Sub
End Sub

Worked perfectly ... thank you!
Reply With Quote