+ Reply to Thread
Results 1 to 6 of 6

Weekly Sales moved to Master, if match conditions replace existing other wise new line

  1. #1
    Registered User
    Join Date
    07-08-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    79

    Weekly Sales moved to Master, if match conditions replace existing other wise new line

    Hello,

    Helping out a friend with his coffee sales spreadsheets.

    He would like his weekly sales figures moved to his master at a click to stop errors.

    Im happy with my basic code but i know it will break, if he clicks twice because the codes just dumps the cells required into the last row of my mastersheet ("TotalSales") or wsSales

    I wrote a code to Find matching dates but dont know how to incorporate it into my "copy into other sheet" macro.

    Any other suggestions welcome about the workbook (he likes his weekly sales on hand, but im struggling to think of how i can do a weekly sales template to stop at the end of the month and then start again next month but still be 7 days)

    Thanks crew

    gws

    Template.xlsm

    Please help

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

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

    Re: Weekly Sales moved to Master, if match conditions replace existing other wise new line

    why are you requiring to call function lastrow for each occurrence in your loop?
    also your current code does not count sunday
    is that and error or left off on purpose?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-08-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Weekly Sales moved to Master, if match conditions replace existing other wise new line

    Humdingaling calling the lastrow function everytime is just my inexperience shining through

    not including sunday is an error/oversight

    what a the thoughts please, Am I on the right track?

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

    Re: Weekly Sales moved to Master, if match conditions replace existing other wise new line

    Heres my take of the situation
    you only need to copy 2 cells from template over to summary so really dont need to over complicate it

    your template is a template so the loop will always been the same
    1-7 for your seven days....so why not just indicate that in your loop

    as your seven days is constant you can use that as a reference point in your loop instead of using offset's and allocating ranges

    last row can be just incremented in your loop itself so there is no need to call on it like you did with your function
    ie lrow = lrow + 1

    Please Login or Register  to view this content.
    as i didnt know how your loop worked i just re-coded it from scratch
    but all you need to do to amend yours is put some kind of checking mechanism

    all i added as a check on the last date to see if it matches the last date on your template
    if they match, msgbox already processed
    of course you have have more complex's matches to match every day but really do you require it?
    Last edited by humdingaling; 07-16-2013 at 04:42 AM.

  5. #5
    Registered User
    Join Date
    07-08-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Weekly Sales moved to Master, if match conditions replace existing other wise new line

    i like it, clean and simple cheers

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

    Re: Weekly Sales moved to Master, if match conditions replace existing other wise new line

    now with your weekly thing
    so you an extra line with the total down the bottom of each download?

    wont be very hard to add extra code into the Else loop

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Location Wise Inventory Report from Master Data of Inward & Outward
    By pakhare.kiran in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2013, 04:18 PM
  2. [SOLVED] I want change the data row wise to coloum wise & coloumn wise to row wise.
    By satputenandkumar0 in forum Excel General
    Replies: 3
    Last Post: 12-20-2012, 08:34 AM
  3. linking weekly sales report to monthly sales report
    By sueatcigaretshopper in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2012, 09:22 PM
  4. copy week total in weekly sales worksheet to appropriate week in monthly sales
    By Sandy2976 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-15-2009, 01:04 PM
  5. [SOLVED] weekly sales
    By Rheyjune in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-20-2006, 02:30 AM

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