Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting more than one column
What would the VBA code be to insert 6 columns to the left of Col A? I
recorded a macro but I know there has to be a quick line of code that will do the same things rather than 10 lines of code from the macro recorder. Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting more than one column
Hi
Columns("A:F").Insert Shift:=xlToRight -- Regards Roger Govier "SITCFanTN" wrote in message ... What would the VBA code be to insert 6 columns to the left of Col A? I recorded a macro but I know there has to be a quick line of code that will do the same things rather than 10 lines of code from the macro recorder. Thank you. __________ Information from ESET Smart Security, version of virus signature database 4751 (20100107) __________ The message was checked by ESET Smart Security. http://www.eset.com __________ Information from ESET Smart Security, version of virus signature database 4751 (20100107) __________ The message was checked by ESET Smart Security. http://www.eset.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting more than one column
The generalize form of Roger's statement would be this...
NumberOfCols = 6 Columns("A").Resize(,NumberOfCols).Insert Shift:=xlToRight where you can set a variable number of columns to insert, as needed. Make sure you note the comma in front of the variable named NumberOfCols inside the Resize property call. -- Rick (MVP - Excel) "Roger Govier" <roger@technology4unospamdotcodotuk wrote in message ... Hi Columns("A:F").Insert Shift:=xlToRight -- Regards Roger Govier "SITCFanTN" wrote in message ... What would the VBA code be to insert 6 columns to the left of Col A? I recorded a macro but I know there has to be a quick line of code that will do the same things rather than 10 lines of code from the macro recorder. Thank you. __________ Information from ESET Smart Security, version of virus signature database 4751 (20100107) __________ The message was checked by ESET Smart Security. http://www.eset.com __________ Information from ESET Smart Security, version of virus signature database 4751 (20100107) __________ The message was checked by ESET Smart Security. http://www.eset.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting text in column dependant on another column | Excel Worksheet Functions | |||
Inserting a column | Excel Discussion (Misc queries) | |||
inserting new column | Excel Discussion (Misc queries) | |||
Inserting row/Column | Excel Discussion (Misc queries) | |||
inserting a column to the right | Excel Programming |