View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Insert Column to the left in a list

Assumes a header row in row 1

Sub addcolumnbeforelastcolumn()
Columns(Cells(1, Columns.Count).End(xlToLeft).Column).Insert
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Shane" wrote in message
...
I am using lists to help with my data, and I want to be able to add a
new column when the month starts. So I want to add a column in the
list to the left of my total column. When I record my steps with the
Macro recorder it gives me this.

Selection.ListObject.ListColumns.Add (28) which always puts a new
column at the 28 position.

the other code of

ActiveCell.Offset(0, 1).EntireColumn.Insert

doesn't work with lists. I have named the range of the total row to
Total12 (because I am summing the most recent 12 months). Thanks for
your help.

Shane