VBA Express Forum  




Go Back   VBA Express Forum > VBA Code & Other Help > Excel Help
     Feedback     
Register FAQ Members Arcade Knowledge Base Training Articles Consulting

Reply
 
Thread Tools Display Modes
Old 04-15-2012, 04:01 AM   #1
Phoenix1

 
Joined: Apr 2012
Posts: 2
Kb Entries: 0
Articles: 0
Inserting columns using VBA

I have a lot of tables of information on one worksheet. Each table is separated by an empty column. I need to be able to write a code that will insert an extra column between each table. All tables are 8 columns wide and use 50 rows. Can anyone help please?

Local Time: 11:31 AM
Local Date: 05-23-2013
Location:

 
Reply With Quote Top
Old 04-15-2012, 11:50 AM   #2
xld
 
xld's Avatar
Distinguished Lord of VBAX

 
Joined: Apr 2005
Posts: 23,118
Kb Entries: 3
Articles: 2
Off the top

VBA:
With Activesheet lastcol = .Cells(1, .Columns.Count).End(xlToLeft).Column For i = lastcol - 8 To 9 Step -1 .Columns(i).Insert Next i End With
VBA tags courtesy of www.thecodenet.com


____________________________________________
Nihil simul inventum est et perfectum

Abusus non tollit usum

Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber

Local Time: 11:31 AM
Local Date: 05-23-2013
Location:

 
Reply With Quote Top
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 03:31 AM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2012 VBA Express