Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 19, 9:29*am, Shane wrote:
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 Nevermind. I figured it out. Thanks anyway |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("Total12").EntireColumn.Insert
Should insert new column and move the Total12 to the right. "Shane" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 19, 9:45*am, JLGWhiz wrote:
Range("Total12").EntireColumn.Insert Should insert new column and move the Total12 to the right. "Shane" wrote: 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 Thanks, it worked great. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I insert quotation marks to a list of numbers in a column? | Excel Discussion (Misc queries) | |||
Column labels run right to left, not left to right | Excel Discussion (Misc queries) | |||
Insert column entries from a master list | Excel Worksheet Functions | |||
Insert column entries from a master list | Excel Worksheet Functions | |||
Insert column entries from a master list | Excel Worksheet Functions |