+ Reply to Thread
Results 1 to 10 of 10

Search account numbers and paste into new column

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Search account numbers and paste into new column

    Hey everyone, I'm a newbie to the sight but like what I've seen so far. I've got a little issue with writing a macro for a sheet. I need to do this every month and the sheet will look a little different each time, i.e. will not necessarily have the same number of lines between under each account number. What I need the macro to do is insert a new column A, find the account code (code in the cell next to cell containing 'Account Code) enter the account code in column A all the way down until a new account begins. I'm making a pivot table of the data so I need to filter by an account code. I'll paste a before and after of an abbreviated version. After.xlsBefore.xls

    Many thanks in advance.

    Dane

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Search account numbers and paste into new column

    Add in A column this formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-03-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Search account numbers and paste into new column

    There are different account codes going down, not just 1-2-05/300.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Search account numbers and paste into new column

    Column A
    Please Login or Register  to view this content.
    hard code

    Filter after wards @
    Account Code:
    Account Total :
    Report Total :
    to remove the unwanted lines

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Search account numbers and paste into new column

    Didn't notice before.. Here:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-03-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Search account numbers and paste into new column

    Sorry to bore you, dark Excel lord. It is not just C3 that needs to be brought into column A but also C9, C13 and C23. Everything below and account code needs to entered until the next account code starts. Look at my 'After' file to see. I tried to drag your formula down column A and it doesn't return the right account codes. I do appreciate the quick reply though. Thanks.

  7. #7
    Registered User
    Join Date
    06-03-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Search account numbers and paste into new column

    Ah almost! It doesn't seem to work on the last of each of the accounts. For example rows 7,11,21 and 24. Any idea why? Thanks for the help zbor

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Search account numbers and paste into new column

    Put formula in 4th row and pull down.

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Search account numbers and paste into new column

    not sure you understand my answer
    see attached sheet

    hard code results in column A
    then filter the unwanted lines which are

    Account Code:
    Account Total :
    Report Total :
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-03-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Search account numbers and paste into new column

    brilliant, thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1