+ Reply to Thread
Results 1 to 5 of 5

Insert a blank Column Every 9 Columns

  1. #1
    Nigel Bennett
    Guest

    Insert a blank Column Every 9 Columns



    I am looking for some help with inserting a blank column
    every 9 columns, the count needs to start from and include
    Column D and then every 9 columns insert a blank column
    unless the column is allready there, I have code that
    checks for a blank column and resizes it, I just need the
    portion to insert the blank column if it doesn't exist

    thanks
    Nigel


  2. #2
    Bob Phillips
    Guest

    Re: Insert a blank Column Every 9 Columns

    "Nigel Bennett" <nigelben@yahoo.com> wrote in message
    news:060d01c52977$70cc6e60$a401280a@phx.gbl...
    >
    >
    > I am looking for some help with inserting a blank column
    > every 9 columns, the count needs to start from and include
    > Column D and then every 9 columns insert a blank column
    > unless the column is allready there,


    The column is always there, all the way up to 256. What exactly do you mean?



  3. #3
    Alok
    Guest

    RE: Insert a blank Column Every 9 Columns

    Hi
    Try

    Sub InsertBlankColumns()
    Dim wStart%
    Dim wStep%
    Dim iCol%

    wStart = 4
    wStep = 9
    iCol = wStart
    Do While iCol < 256
    'check if iCol is blank
    'if this means that there is not data in the cells
    If Application.WorksheetFunction.CountA(Sheet1.Columns(iCol)) <> 0
    Then
    Sheet1.Columns(iCol).EntireColumn.Insert
    End If
    iCol = iCol + wStep
    Loop

    End Sub



    "Nigel Bennett" wrote:

    >
    >
    > I am looking for some help with inserting a blank column
    > every 9 columns, the count needs to start from and include
    > Column D and then every 9 columns insert a blank column
    > unless the column is allready there, I have code that
    > checks for a blank column and resizes it, I just need the
    > portion to insert the blank column if it doesn't exist
    >
    > thanks
    > Nigel
    >
    >


  4. #4
    Nigel Bennett
    Guest

    Re: Insert a blank Column Every 9 Columns

    Sorry I wasn't more specific, if the column is blank
    ignore it otherwise insert the blank column, I already
    have code that will let me know if the column is blank, I
    am looking for something that would insert a column every
    9 columns starting from column d
    >-----Original Message-----
    >"Nigel Bennett" <nigelben@yahoo.com> wrote in message
    >news:060d01c52977$70cc6e60$a401280a@phx.gbl...
    >>
    >>
    >> I am looking for some help with inserting a blank column
    >> every 9 columns, the count needs to start from and

    include
    >> Column D and then every 9 columns insert a blank column
    >> unless the column is allready there,

    >
    >The column is always there, all the way up to 256. What

    exactly do you mean?
    >
    >
    >.
    >


  5. #5
    Bob Phillips
    Guest

    Re: Insert a blank Column Every 9 Columns


    This should do it then

    For i = 256 To 4 Step -9
    If Application.Count(Columns(i)) > 0 Then
    Columns(i).EntireColumn.Insert
    End If
    Next i




    RP
    (remove nothere from the email address if mailing direct)


    "Nigel Bennett" <nigelben@yahoo.com> wrote in message
    news:066a01c5297c$3f544ce0$a401280a@phx.gbl...
    > Sorry I wasn't more specific, if the column is blank
    > ignore it otherwise insert the blank column, I already
    > have code that will let me know if the column is blank, I
    > am looking for something that would insert a column every
    > 9 columns starting from column d
    > >-----Original Message-----
    > >"Nigel Bennett" <nigelben@yahoo.com> wrote in message
    > >news:060d01c52977$70cc6e60$a401280a@phx.gbl...
    > >>
    > >>
    > >> I am looking for some help with inserting a blank column
    > >> every 9 columns, the count needs to start from and

    > include
    > >> Column D and then every 9 columns insert a blank column
    > >> unless the column is allready there,

    > >
    > >The column is always there, all the way up to 256. What

    > exactly do you mean?
    > >
    > >
    > >.
    > >




+ 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