The following goes down each column checking the account name against the new accoun name. Once the alphabetical insertion point is found, it exits the loop, then inserts a new column at that point and adds the new accounts name.
On Sheet1 I have the following in the first row:
acme bondoogle chuckie delite
Here's the code that finds the insertion point for "catville"
Code:
Option Explicit
Sub FoundNewAccount()
FindInsertColumn ("catville")
End Sub
Sub FindInsertColumn(NewAccount As String)
Dim lColumnNum As Long 'The current column we're looking at in the loop
Dim lTotColumns As Long 'Total number of columns with account
Dim stAccountInCurrentColumn As String
lColumnNum = 1
With Sheet1 'If you look in the project explorer, each sheet has two names. This reference
'is to the name NOT in parantheses.
'You can change the name not in parentheses in the properties window.
'One advantage of using this over
' Sheets("Sheet1") is that it is strongly typed meaning you get the pop-up
' help when you code
'Get the number of colums to look through
lTotColumns = WorksheetFunction.CountA(.Range("1:1")) 'Get total columns
For lColumnNum = 1 To lTotColumns
stAccountInCurrentColumn = .Cells(1, lColumnNum)
If NewAccount < stAccountInCurrentColumn Then 'we've found the insertion point
Exit For 'jump out of loop
End If
Next
.Cells(1, lColumnNum).EntireColumn.Insert 'Insert a column
.Cells(1, lColumnNum) = NewAccount 'Add the new account
End With
End Sub
One thing to note is that checking account names the way i did will differentiate between an uppercase "C" and a lowercase "c"
Hopefully that will get you started down the right path