Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Nigel Bennett" wrote in message
... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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" wrote in message ... 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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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.Column s(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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert 3 blank rows wherever the date changes in column???? | Excel Discussion (Misc queries) | |||
insert a blank column between each column in a data file | Excel Discussion (Misc queries) | |||
insert a blank row after data changes in a column | Excel Discussion (Misc queries) | |||
Insert Blank Column every 9 Columns | Excel Programming | |||
When sorting info in columns, can I make it insert blank line bet. | Excel Worksheet Functions |