+ Reply to Thread
Results 1 to 15 of 15

Copy single row to new worksheet / delete blank rows

  1. #1
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Copy single row to new worksheet / delete blank rows

    Hi all,

    First off, thank you for anyone who attempts to help me on my first (probably of many!) problems that I'm posting here tonight.

    I've been given the rather difficult task of setting up a new sales spreadsheet for some telesales agents in my work. It's split over three different sheets in one workbook:
    Sales / Retentions / Stats

    The "Sales" worksheet is where they enter all their sales (rather obvious that one) but it can be more than one line per customer, depending on how many products the customer buys.

    The "Retentions" worksheet is intended to be one line per customer, which I've tried creating (I'll be honest, copied from the Internet!) that will take the customers name and date of application from the Sales worksheet and have extra information added for dates of callbacks etc.

    The "Statistics" worksheet is purely for administration and requires manual entry at this point.

    The problem I have is this:
    The macro I have blatantly plagiarised is causing me massive issues. I have the following setup on this worksheet:
    Name | Date Applied | Retention Call 1 | Retention Call 2 | Retention Call 3 | Retention Call 4
    Name and Date applied should be copied over from the Sales worksheet (which works) but I only want one (unique) line for each customer, the macro itself copies over blank lines as well. I also have formulas (IF and VLOOKUPs) running on the date fields to autopopulate dates that the agents should be calling the customer back on.
    Another macro I have in the workbook attempts to delete these blank lines copied over but it also deletes my IF's and VLOOKUP's at present, which is annoying!

    I probably haven't explained this very well as I've been at this for the last 5 hours at work and have hit a brick wall. If anyone can offer any help, please do!
    Last edited by stevejfice; 10-27-2011 at 03:44 PM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro dilemma

    hi, stevejfice, can you post sample workbook?

  3. #3
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Copy single row to new worksheet / delete blank rows

    Workbook should be attached.

    Have just realised I'm missing a VLOOKUP from the Retentions worksheet, but this only pulled across the "Date Applied" from the Master Sales sheet, and there's probably a cleaner way to do it via macro anyway.

    I hope people are understanding what I'm attempting to do
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy single row to new worksheet / delete blank rows

    it would be helpful to see some fake data on sheet1 and what you expect to see on sheet2

  5. #5
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Copy single row to new worksheet / delete blank rows

    Quote Originally Posted by watersev View Post
    it would be helpful to see some fake data on sheet1 and what you expect to see on sheet2
    The content isn't particularly important, but I've uploaded a few dummy cells on the relevant sheet now. What should be copied across is one line for each customer containing the Name and the Date they applied, and then the formulas automatically work out the dates we need to contact them (retention week 1, etc).

    So, ultimately, even though I can have multiple lines per client on the first sheet, I only one one automatically created on the second.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy single row to new worksheet / delete blank rows

    please check attachment, run code "test", check sheet2
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Copy single row to new worksheet / delete blank rows

    Quote Originally Posted by watersev View Post
    please check attachment, run code "test", check sheet2
    Wow, amazing! Thank you very much, you even got the dates right for the retention calls

    Now if I could work out a way to automatically increment a sale on the statistics page at the same time that would be perfect, but I think that's above any kind of macro to work out that.

    But again, thank you very much.

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy single row to new worksheet / delete blank rows

    can you give some details for the third sheet, example data on all three sheets will be nice

  9. #9
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Copy single row to new worksheet / delete blank rows

    Certainly can.

    Each unique customer translates to one "Client", and each entry in the Lender column on Monthly Sales is a claim, case value is from the "amount" column on the same.

    The issue I can foresee happening is Excel not being able to differentiate between the days of the week the client/claim is added (I have never seen it do anything that sophisticated), but you're welcome to give it a go if you think it's possible.

    Broken down it means:
    New Unique Client = 1 added to client column for that day
    New claim for that client = 1 added to claim column for that day (each unique client can have anything up to a dozen or more claims)
    Amount added the same days case value column.

    I can guess you can tell that this would need to appear on different days, and weeks as the month goes by.

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy single row to new worksheet / delete blank rows

    as it's a monthly sales sheet, it might happen that the same customer can appear a couple of times within one month but on a different date. What should happen then? (question for sheet2)

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy single row to new worksheet / delete blank rows

    as it is now the code will take first instance of a cutomer name and corresponding date, all other instances of the same cutomer will be ignored. Is it correct.

    Re: sheet3, visual example will be nice to get in addition to your explanation

  12. #12
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Copy single row to new worksheet / delete blank rows

    It's very rare (as in it's never happened in the last six months) that we get a customer named the same thing twice, and I can't envisage it happening in the same month at all. The Customers that appear on this sheet then get handled by a separate part of the company who are lucky enough to have proper databases.

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy single row to new worksheet / delete blank rows

    What about sample to support your explanation for sheet 3? How do you count weeks: starting from the 1 date of the month or the weekday it falls on? Is Statistics goes for one month or for the whole year?

  14. #14
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Copy single row to new worksheet / delete blank rows

    Ok, I've transferred the data from the sheet you worked on for me, which translates to 2 clients, 2 claims and a total of £17,000 (and I've used today, the 4th Thursday of this month to make it easier).

    If an agent was to get 3 clients and 6 claims tomorrow with a case value of £80,000 those values would appear in Friday, below the data present now.

    The issue I can see occurring is how to make the data appear reflected against the relevant day. But then you seemed to fix my other problems as if they were nothing so here's hoping!
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy single row to new worksheet / delete blank rows

    here is one of the ways to make it, please check attachment, run code "SalesStat"
    Last edited by watersev; 10-29-2011 at 10:37 AM.

+ 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