Hello, few years back. I do have problem finding last empty cell on a column and inserting, copy paste the last non empty column. Now, I do have same problem again but this time I have to copy the last 3 non empty columns and paste it on 3 inserted column. Here is the piece of successful code with my previous problem. Hope you can modify it. Thanks!
Sub AddCol()
Dim rng As Range, c As Range
Set rng = Intersect(ActiveSheet.UsedRange, Rows(2)) ' Isolate row 2
If rng Is Nothing Then Exit Sub ' Assuming there is more than one row
Set c = rng.Cells(rng.Cells.Count) ' Isolate the last cell in row 2
If IsEmpty(c) Then Set c = c.End(xlToLeft) ' Find the last non-empty cell
If Not IsEmpty(c) Then
Set rng = Intersect(c.EntireColumn, ActiveSheet.UsedRange) ' Isolate the used area of the column
rng.Copy ' Copy to clipboard
rng.Insert Shift:=xlToRight ' Duplicate
c.Offset(0, -1).Select ' Select the "marker" in the duplicate column
Application.CutCopyMode = False ' Switch off the CutCopy marquee
End If
End Sub
Bookmarks