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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top