+ Reply to Thread
Results 1 to 6 of 6

How to quickly insert blank column between every other column

  1. #1
    Registered User
    Join Date
    11-08-2014
    Location
    Cranberry Township, PA
    MS-Off Ver
    OFFICE 365
    Posts
    12

    How to quickly insert blank column between every other column

    Hi All

    I would like to place a blank column in J, L, N, P, R, T, V, X and so on up to HN.

    This is the code I'm using
    Please Login or Register  to view this content.
    Every time I run it I get an error.

    Can someone point me in the right direction?

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit
    Posts
    636

    Re: How to quickly insert blank column between every other column

    When you say "I get an error" do you mean "I don't get the right spacing" ?
    I would change the parameters of your For/Next if you need to start from J and end with HN, this way:
    Please Login or Register  to view this content.
    Last edited by rollis13; 10-25-2021 at 05:56 PM.

  3. #3
    Registered User
    Join Date
    11-08-2014
    Location
    Cranberry Township, PA
    MS-Off Ver
    OFFICE 365
    Posts
    12

    Re: How to quickly insert blank column between every other column

    Rollis13

    Thank you for your help but I get an error as well using this code
    Please Login or Register  to view this content.
    The error is : Run-time error '1004'
    Insert method of range class failed.

  4. #4
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit
    Posts
    636

    Re: How to quickly insert blank column between every other column

    As you may have understood your code was already in working conditions, this means the problem is in your sheet. Maybe you have other hidden or locked cells or even merged cells. Test on a new sheet or cleanout this one deleting all columns after HN and all rows under the last used row and check for merged cells.

  5. #5
    Registered User
    Join Date
    11-08-2014
    Location
    Cranberry Township, PA
    MS-Off Ver
    OFFICE 365
    Posts
    12

    Re: How to quickly insert blank column between every other column

    Thank you for all your help. The VBA is working as intended.

    Again Rollis thank you!

  6. #6
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit
    Posts
    636

    Re: How to quickly insert blank column between every other column

    Glad having been of some help .

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Insert A Blank Row When Column Value Changes
    By Ourkid123uk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2019, 07:06 AM
  2. Replies: 13
    Last Post: 09-19-2013, 06:54 PM
  3. [SOLVED] Compare 4 column values then insert a 5th columns value to a blank column/cell value
    By JasonKMcCoy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-27-2012, 06:01 PM
  4. cannot insert column due to non blank cell
    By stevekirk in forum Excel General
    Replies: 3
    Last Post: 04-20-2008, 11:10 PM
  5. insert a blank column if a cell is blank...how?
    By bego in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2007, 03:04 AM
  6. How to quickly insert a blank row every 5 rows?
    By Med in forum Excel General
    Replies: 2
    Last Post: 09-09-2005, 08:05 PM
  7. [SOLVED] Insert a blank Column Every 9 Columns
    By Nigel Bennett in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2005, 01:06 PM

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