Filling in account numbers from groups

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It seems logical in my head, but am a new user hoping someone can help.
Importing a report from text, I am left a register of transaction groups.
There is a single account number located to the left and at the top of a
series of rows that include the transactions of that account over the course
of a year. The account # is in the cell immediately to the left of the
first transaction.

I am simply trying to fill in the account number along side each cell to the
left of every transactions that are related under that account so I can
begin sorting and analyzing the overall data by date. Its a file with 172M
transactions. The only universal thing I can see after the import is that
each group of transaction under an account number is seperated by a row of
null data.

I appreciate any help, and apoligize in advance if it looks like I am just
not letting go of my Excel roots.
 
Unless someone with a cuter trick can help, I would suggest a change in your
import process, an append query, and some VBA code to make this happen.

First, create an import table that has the same structure as the file you
are importing. It should include the column where the account number is.
Once you have the data into the table, you could use a routine like this
(untested air code) to append the records. Create an append query, but where
the account number is, reference a function. This function will use the
account number if it is not null and use the last account number that was not
null.

Public Function FixAccountNumber(varAccount As Variant) As String
Static strAccountNumber As String

If Not IsNull(varAccount) Then
strAccountNumber = varAccount
End If
FixAccountNumber = strAccountNumber
End Function
 
Back
Top