Add multiple columns in between

  • Thread starter Thread starter NM
  • Start date Start date
N

NM

Hi,

I have coulmns A through CJ and I want to add 27 coulmns before column O.
What is the easiest way to do it?

Thanks for your help.
Nee
 
Try this idea
Sub insertcols()
mc = "o" 'tested with "d"
cti = 27 ' tested with 2
Columns(mc).Offset(, -cti).Resize(, cti).Insert
End Sub
 
It doesn't work, its giving error!

Don Guillett said:
Try this idea
Sub insertcols()
mc = "o" 'tested with "d"
cti = 27 ' tested with 2
Columns(mc).Offset(, -cti).Resize(, cti).Insert
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 
Thanks David,it worked.

But I want to how do we know that from column O to AO it is 27 columns? Do
we count all the way from O to AO to see if that equals 27 or is there a
easier way to know that?

Thanks!
 
Perhaps you really meant column Ao since (I should have tested with col o)
col O is column 15 and you can't subtract 27 from 15 to get -column 12
 
Hi,

1. Type O:AO into the Name Box and press Enter
2. Press Ctrl++ (Control Plus)

Cheers,
Shane Devenshire
 
This means it has to be done manually, excel doesn't tell you the column name
equivalent to the number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top