+ Reply to Thread
Results 1 to 4 of 4

Insert Multiple Columns Between Data

  1. #1
    Registered User
    Join Date
    12-12-2006
    Posts
    17

    Question Insert Multiple Columns Between Data

    Hi,

    Am after inserting 5 Columns between data. Does anyone have the code for this?

    I have the code for 2 columns - but unfortunately do no tunderstand how to tweak it in order to insert it for 5 columns.

    Code for 2 columns

    Sub InsertCol()
    Dim i As Integer
    Range("B1").Select
    For i = 1 To 100
    Selection.Columns("A:B").EntireColumn.Insert
    ActiveCell.Offset(0, 3).Select
    Next i
    End Sub

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Just change the selection to
    Selection.Columns("A:E").EntireColumn.Insert
    and adjust the offset()
    ActiveCell.Offset(0, 6).Select


    HTH
    Carim

  3. #3
    Registered User
    Join Date
    12-12-2006
    Posts
    17

    Smile Thank you

    Thanks Carim, beginning to understand how the code works now.

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Glad it fixed your problem.

    Thanks for the feedback

    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1