Rowland Hamilton
Active Member
- Joined
- Nov 13, 2009
- Messages
- 250
Trying to move the "Misc. Rev" Column to the right of the "Veratax" column. What am I doing wrong? I don't want to specify the exact cells because the position of these columns can change. But, all my attempts to copy, go to another part of the sheet through searches and arrows, then paste in the relative spot I arrive in aren't working. Only when I select an exact cell between copy and paste have I been able to get this to work. The code thus far:
Thank you, Rowland
Code:
Sub test_cut_move()
'Move Misc. Rev to end, delete check column
Rows("6:6").Select
Selection.Find(What:="Misc Rev", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.EntireColumn.Select
Selection.Cut
Rows("6:6").Select
Selection.Find(What:="veratax", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select
Selection.End(xlUp).Select
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).Select
Selection.EntireColumn.Delete
End Sub
Thank you, Rowland