Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Column and insert
I have the following code that inserts a column next to the active column.
Sub AddColumnt() ActiveCell.Offset(0, 1).EntireColumn.Insert End Sub I would like to copy and paste A1:A10 into the new column. What do I need to add to the macro? Thanks so much! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Column and insert
Denise
You don't actually say where you want the range copied to but this amendment copies it to the cells adjacent to the active cell. Sub AddColumnt() ActiveCell.Offset(0, 1).EntireColumn.Insert Range("A1:A10").Copy ActiveCell.Offset(0, 1) End Sub Regards Trevor "Denise" wrote in message ... I have the following code that inserts a column next to the active column. Sub AddColumnt() ActiveCell.Offset(0, 1).EntireColumn.Insert End Sub I would like to copy and paste A1:A10 into the new column. What do I need to add to the macro? Thanks so much! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Column and insert
Sorry it did get CF but not cell format (borders) or formulas
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Column and insert
Denise
it's just a copy statement. It should, and does, copy everything. The formulae will, of course relate to cells relative to where they have been copied to, so the results may be "wrong". I have just tested that it copies borders, conditional formatting and formulae. Regards Trevor "Denise" wrote in message ... Thanks Trevor this works great. However its not copying the formatting both the cells and conditional formatting. If does on the other hand pickup validation. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert Column after specific text title the new column and add for | Excel Discussion (Misc queries) | |||
insert a blank column between each column in a data file | Excel Discussion (Misc queries) | |||
insert row / insert column command buttons | Excel Worksheet Functions | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Move/Copy or Copy/Insert worksheet? | Excel Discussion (Misc queries) |