Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2007

Tip: Looking for answers? Try searching our database.

EXCEL Column Adjustment

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wchau81@gmail.com - 16 Feb 2007 20:32 GMT
Hi,

I'm not sure if this is possible, but any help would be great.

I want to add two new columns in between every current column I have
now.  For example

Current:
ABCDEFG

Desired:
A (Space) (Space) B (Space) (Space) C....etc.  There are lots and lots
of column so the manual add will not be efficient.

Thanks for any assistance.

William
Dave Peterson - 16 Feb 2007 21:52 GMT
Actually, it might not be too bad.

Select columns B:C, then rightclick on the selection and choose Insert

Now select E:F and hit F4 (repeat last action)

But you could use a macro, too:

Option Explicit
Sub testme()
   Dim iCol As Long    
   With Worksheets("sheet1")
       For iCol = .Cells(1, .Columns.Count).End(xlToLeft).Column To 2 Step -1
           .Columns(iCol).Resize(, 2).Insert
       Next iCol
   End With
End Sub

I used row 1 to find the last used column.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

> Hi,
>
[quoted text clipped - 13 lines]
>
> William

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.