I'm using this macro to help me move a row of data in excel up one row. When i use autofilter and have columns hidden, it is not moving the hidden columns - just the columns that is not hidden. however when i do not have any autofilter, it is moving the full row (including the hidden rows). Any ideas on how to fix this? I wonder if the Activecell.row is the right logic to use here?
End Sub
VBA Code:
sub upwards
Dim tmp As Long
tmp = 5000
If ActiveCell.Row <> Rows.Count And ActiveCell.Row > 2 Then
Cells(ActiveCell.Row + 1, 1).EntireRow.Copy Cells(tmp, 1)
ActiveCell.EntireRow.Copy Cells(ActiveCell.Row + 1, 1)
Cells(tmp, 1).EntireRow.Copy Cells(ActiveCell.Row, 1)
ActiveCell.Offset(1, 0).EntireRow.Select
End If
End Sub
End Sub