Hi, I have this code to copy selected columns to last empty row of same selected range. Previously acquired by @Peter_SSs
Works well for me. Due to the large amount of rows in the file, I had to filter them according to a specific criterion. I currently want to modify it so I can copy only the visible rows.
If there are hidden rows, unfortunately I did not succeed. I tried to put selection.specialcells(xlcelltypevisible) to no avail.
Works well for me. Due to the large amount of rows in the file, I had to filter them according to a specific criterion. I currently want to modify it so I can copy only the visible rows.
If there are hidden rows, unfortunately I did not succeed. I tried to put selection.specialcells(xlcelltypevisible) to no avail.
VBA Code:
Sub macro_v3()
Dim nextrw As Long
With Selection
nextrw = .EntireColumn.Find(What:="?*", Searchorder:=xlByRows, Searchdirection:=xlPrevious).Row + 1
.Offset(nextrw - .Row).Value = Application.Index(Selection, Evaluate("row(1:" & .Rows.Count & ")"), Array(2, 1))
End With
End Sub