list of accounts

  • Thread starter Thread starter Mark Jeffcoat
  • Start date Start date
M

Mark Jeffcoat

I have produced an Excel speadsheet expense report that
requires account numbers. Each expense is listed on a
worksheet with the appropriate acount number. I have a
summary page that sums expenses by account number but
only if you manually enter the account number. Is there
a way to have Excel produce the list of accounts (they
may change every month) on the summary page and then sum
by accounts from the expense list.
 
Mark

modify to suit:

Sub CreateAccountList()
Dim ws As Worksheet
Dim lRow As Long ' row counter
lRow = 1 ' set to a suitable start value
For Each ws In Worksheets
If ws.Name <> "Summary" Then
lRow = lRow + 1
ws.Range("A2:B2").Copy Sheets("Summary").Range("A" & lRow)
End If
Next
End Sub

Regards

Trevor
 
Back
Top