I have a listobject bound to a sharepoint list. I am trying to use vba to move the columns around. It is possible to click on a header and drag a column from one location in the list to another. When I record this action in a macro and then attempt to run the code again. It fails. There are no errors generated but it fails to actually move the column. It inserts a new column in the correct place but fails to copy the source into the new column and fails to remove the source from its original column. Here is the vba code that is generated:
Sub Macro5()
' Macro5 Macro
Range("ProjectList[[#Headers],[Account]]").Select
Selection.Cut
Range("ProjectList[[#All],[Title]]").Select
Selection.Insert Shift:=xlToRight
End Sub
I’m just wondering if anyone has done this before. If so offer some suggestions. I’ve researched the web for awhile and I’m coming up empty.
Sub Macro5()
' Macro5 Macro
Range("ProjectList[[#Headers],[Account]]").Select
Selection.Cut
Range("ProjectList[[#All],[Title]]").Select
Selection.Insert Shift:=xlToRight
End Sub
I’m just wondering if anyone has done this before. If so offer some suggestions. I’ve researched the web for awhile and I’m coming up empty.