+ Reply to Thread
Results 1 to 26 of 26

Look up a value in last sheet and cop it to the next

  1. #1
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Look up a value in last sheet and cop it to the next

    Evening all hope someone can help!

    Very rusty on excel these days.

    Please see the attached spreadsheet:

    When you see the sheet first sheet is irrelevant as new tax year but there after i would like:

    P9 =
    Look up value of P9 in previous sheet and add the value of L9 in active/current sheet.

    Q9 =
    Look up value of Q9 in previous sheet and add the value of M9 in active/current sheet.

    Hope you can help and thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Look up a value in last sheet and cop it to the next

    I tried to take at look at this for you but when I clicked the button to create the new sheet, I kept getting errors no matter what I tried or modified in the code. It has to do with naming the sheet, the sheet name (I think) is supposed to be the InputBox value...but the name is always blank with the next number in (). After it names the sheet, the code errors....for me anyway.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Look up a value in last sheet and cop it to the next

    Hi thanks for trying to take a look. I have just tried it on my laptop and seems to be working fine? The date has to be put in with hyphens not forward slashes? Do you have any idea about copying the values from previous s

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    Hi mezza89

    Are you sure it is P9 & Q9 and not P11 & Q11 as the latter has no values
    Unless your formulas are as folllows:
    O11 =
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

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

    Or perhaps P9 = P11, Q9 = Q11, O9 = O11 ?


    Edited: Code to be fixed
    Last edited by Sintek; 04-16-2017 at 03:07 PM. Reason: Added Code
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    And also, should the information in the week, once the total has ben stored not be cleared prior to the new sheet en created.

  6. #6
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Look up a value in last sheet and cop it to the next

    I think i added a non updated spreadsheet does this one make more sense?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Look up a value in last sheet and cop it to the next

    Monday to Sunday columns should be cleared on the new sheet just the yearly totals carried over.

  8. #8
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Look up a value in last sheet and cop it to the next

    Ahhh HA! Now it makes sense. I think we would have to put a formula in the code to get what you want here. It will take me a while to figure it out because I'm kind of rusty as to how to put formulas in code. Maybe sintek knows how to or has a better way of doing it that wont take as long.

  9. #9
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Look up a value in last sheet and cop it to the next

    Well any help is hugely appreciated. I use to be very into the programming side but seem to have lost any skill of it over the last few years.

  10. #10
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    Yes, that makes more sense, Here you go...Try this
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sintek; 04-16-2017 at 04:05 PM.

  11. #11
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Look up a value in last sheet and cop it to the next

    sintek, I could be wrong but I think op would like to have P9 not only bring the value from L9 on the previous sheet, but also add the value of L9 on the current sheet to it...to keep a running total of the hours. Same for Q9. That's the part I'm having trouble with figuring out.

  12. #12
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    @gmr4evr1

    That's correct....Not sure if I understand, but herewith my understanding
    Values of current sheet will be stored....When new sheet is created, he will populate with new hours etc etc.
    Then when he creates a another new week, the values of previous sheet plus the val of stored should be tallied...or am I misunderstanding?

  13. #13
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    Quote Originally Posted by gmr4evr1 View Post
    sintek, I could be wrong but I think op would like to have P9 not only bring the value from L9 on the previous sheet, but also add the value of L9 on the current sheet to it...to keep a running total of the hours. Same for Q9. That's the part I'm having trouble with figuring out.
    How would one put a formula into P9 that adds L9 to The value of twhBal...can't figure that out
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  14. #14
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Look up a value in last sheet and cop it to the next

    Exactly where I am stuck. I see how you've worked it out when it adds the new sheet. I was thinking maybe a worksheet selection change event to add L9 to P9 on the current sheet, but I haven't had the chance to try it yet.

  15. #15
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    I've just realized that with my current code, the only way for the OP to get the tally would be to create the new sheet, so........... The solution is the situation we are trying to figure out.

  16. #16
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

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


    Edited formula
    Last edited by Sintek; 04-16-2017 at 05:20 PM. Reason: Edited formula

  17. #17
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Look up a value in last sheet and cop it to the next

    You're on the right track, but the formula is referencing cell AB18 instead of summing P9 & L9. Below is the formula that is placed in P9
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Maybe I put the code you posted in the wrong place?

  18. #18
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Look up a value in last sheet and cop it to the next

    mezza89

    Is this how you wanted?
    Please Login or Register  to view this content.

  19. #19
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    @ jindon

    Flawless code as always
    Last edited by Sintek; 04-17-2017 at 02:13 AM.

  20. #20
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    Quote Originally Posted by gmr4evr1 View Post
    You're on the right track, but the formula is referencing cell AB18 instead of summing P9 & L9. Below is the formula that is placed in P9
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Maybe I put the code you posted in the wrong place?
    @ gmr4evr1...Of course, herewith amended.
    Please Login or Register  to view this content.
    Last edited by Sintek; 04-17-2017 at 02:15 AM.

  21. #21
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Look up a value in last sheet and cop it to the next

    This code seems to work perfectly for what I need. Thank you so much. What does the Clear Balances button do on Sheet 2?

  22. #22
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    It was just to clear the values of the balances when I was testing code.

  23. #23
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Look up a value in last sheet and cop it to the next

    Thanks so much for your help!

  24. #24
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    Pleasure, thanks for the rep point

  25. #25
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Look up a value in last sheet and cop it to the next

    Yay! Glad this one has been resolved. Thanks for the help sintek and jindon!

  26. #26
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Look up a value in last sheet and cop it to the next

    @ gmr4evr1

    No thank you...Could not have done it without your feedback.

+ 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. Replies: 2
    Last Post: 01-18-2014, 10:54 PM
  2. Lookup Value from Sheet 4 in Sheet 2, if found copy Sheet 2 Active Row to Sheet 5
    By lgosso23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 02:51 PM
  3. [SOLVED] Match Value in Sheet 1 with Sheet 2, copy entire row from sheet 1 to new sheet
    By lzyshaman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2013, 07:48 AM
  4. [SOLVED] find code# from sheet 1 on sheet 2, compare value on sheet 1 with value on sheet 2
    By BlakeLee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-27-2013, 01:52 PM
  5. [SOLVED] Worksheet Activate when user selects sheet NOT when sheet is created from a template sheet
    By y0rk1e72 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-26-2012, 02:47 PM
  6. Replies: 11
    Last Post: 10-14-2012, 01:03 PM
  7. Replies: 2
    Last Post: 10-12-2010, 05:00 PM

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