+ Reply to Thread
Results 1 to 4 of 4

Looking portential formatting macro to include specific sales copy and paste.

Hybrid View

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Looking portential formatting macro to include specific sales copy and paste.

    Hello Excelforum,

    I have been using excel quite a lot in the last 3 years but have mostly just used the general formulae in the certain cells required. I am attempting to increase my excel skills by potentially learning some macros and programming skills. I understand there are other threads related to introductory VBA and macro works which I have had a look at.

    Unfortunately I have not been able to find a specific solution to the problem I am facing. I have uploaded a sample spreadsheet of what I am requiring and am wondering if it would be possible to use a macro to make my work a lot easier.

    Their are certain reports which I can import into excel for work which are very useful, but I would also like to manipulate these reports to analyse the data in a different way.

    Basically what I require to do is to insert a new column on the left of the rest of the works and fill this column with the associated customer name so that each row of data has an attachment to the customer and not just under the customer's heading (I hope this makes sense). Once the customer's name has been added in the new column for each row of purchases, the row which contains the customer's name will then be deleted.

    Let me know if this can be done efficiently with a macro or if some other programming may need to be rquired. Once again the inital report style is in the attached spreadsheet and a sample of what I am after is on another page of the same spreadsheet.

    Thank you in advance,

    Lachy725
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,058

    Re: Looking portential formatting macro to include specific sales copy and paste.

    Once you have added your column, put the following formula in cell A3:

    =IF(LEFT(B3,8)="Customer",B3,A2)

    And copy down.

    Then copy all of column A and Paste Special | Values.

    You can then filter on column B to select the Customer headers and delete the rows.

    For a macro, record these steps as you do them manually.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Looking portential formatting macro to include specific sales copy and paste.

    Thanks TMS,

    Your methodology makes sense and am able to follow it well.

    I assume that the function basically asks that if the first 8 letters in the cell are "customer" use that cell if not use the cell above. Unfortunately the report that I have does not have any such similiarities. Eash customer is not named as "customer - A" or "customer B" but more general names like "Smith's Services" or "Dave Pty Ltd".

    A way of differentiating from the sales types and customer rows is obviously required to use your IF formula. I don't think that there are any text related differences that you could determine the customer rows from. The only identifying factor I can think of is the fact that the cells are in navy blue and are in size 11 not size 9.

    Can you differentiate a cell by size or colour?

    Thanks for the hasty response.

    EDIT: In summary - Is there a way for an IF Statement's logical test to be based on text height or text colour?
    Last edited by lachy725; 05-30-2012 at 12:25 AM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,058

    Re: Looking portential formatting macro to include specific sales copy and paste.

    It would, perhaps, be helpful if your sample data was representative of the real world.

    If the cell next to the customer header is always blank, you could test for that.

    Regards, TMS

+ 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