LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Introduce new column using VBA macros

Er - somehow (how!) I read you wanted to insert 6 columns. Ignore my
previous and go with Dana's, or
Columns("E").Insert

Regards,
Peter T

"Peter T" <peter_t@discussions wrote in message
...
Hi Swamy,

If you record a macro -

Columns("E:J").Select
Selection.Insert Shift:=xlToRight

But as recording macros also record unnecessary key strokes like selecting
cells or, in this case, columns, it can be simplified -

Sub InsertColumns()

Columns("E:J").Insert Shift:=xlToRight

End Sub

This assumes of course you want to insert 6 columns between D & E.

Regards,
Peter T

"Swamy" wrote in message
...
Hi,

I have 6 columns already in my Excel document. How can i insert a

column
between 4 and 5 using VBA macros?

Thanks for your help.

Swamy





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Introduce Value in a cell with formula, option Filipemr Excel Discussion (Misc queries) 4 March 17th 07 11:02 PM
Introduce decimal point in a list of values in column. ssb Excel Discussion (Misc queries) 2 December 17th 06 11:19 PM
please introduce sorting by colors in excel DCDK Excel Discussion (Misc queries) 3 October 3rd 06 01:32 PM
please introduce sorting by colors in excel DCDK Excel Discussion (Misc queries) 0 October 3rd 06 11:08 AM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"