+ Reply to Thread
Results 1 to 8 of 8

Update cells

  1. #1
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    76

    Update cells

    I’m not sure what type a problem this is (lookup table, progressive IF statement, VBA, or other issue) but I thought I’d start here. If this should be posted elsewhere, please let me know.

    We have an Excel spreadsheet that tracks our timecard activities. We’re in the process of moving all payroll items to our new system financial software which means all tracking will be done inside the new app not Excel. However, the spreadsheet works so much easier. What I want is to update an Access table from Excel. This gets a bit confusing but I’ll try to explain my problem.

    I’d like to update a cell in one worksheet (DATABASE) based on info from another worksheet (TIMECARD). I have a routine from a kind sole here, that creates a list of rows in DATABASE based on dates entered TIMECARD. Now I need to add a couple additional cells for the PROGRAM and ACTIVITY data. If an entry is made for a date in TIMECARD, then I’d like the PROGRAM and ACTIVITY cells in DATABASE to include that entry for the line corresponding to that specific date.

    I have attached an extremely slimmed down version of my spreadsheet showing what I have in mind.

    In the old Lotus 1-2-3 days, I could have solved this with “keystroke macros”, but now with VBA, I’m totally lost. Any suggestions would be greatly appreciated.

    Thanks,
    Steve Kipping
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Steve: here is a slightly different approach, all of which assumes as in your original that the data in the first sheet is always the same size. Btw you have a lot of empty modules which you could remove to tidy things up.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    76
    This is superb Stephen...

    I'll have to play with this a bit as my full spreadsheet has numerous other cells etc. to update but hopefully I can wade through this. Once I get it all working, I'll go back and cleanup the bogus modules.

    I may need some assistance in the future. I hope you don't mind me possibly imposing on you (and others) a bit more in the future.

    Thanks again,
    SKK

  4. #4
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    76
    Stephen,

    I have modified your code a bit to match the entire spreadsheet. However, I’m still missing a couple things.

    1. I’d like to add the EMPLOYEE number to each record. This is always the same number for each. It is stored in the TIMECARD worksheet in cell N3.
    2. Here’s the tougher one. I forgot about the most important item. We need the hours worked for each activity. I add the HOURS column but have no idea where to go from here.

    Here’s my modified code:



    Again, any suggestions would be greatly appreciated.

    Thanks,
    SKK
    Last edited by VBA Noob; 04-04-2008 at 01:11 PM.

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Try this. Also added a little formatting at the end.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    76
    Stephen,

    I hate to keep bugging you but one more question. If PROGRAM or ACTIVITY cells are blank in the TIMECARD worksheet, it returns incorrect data in the DATABASE worksheet.

    I have attached a full blown copy of our spreadsheet. If you could take one more look at this, I think we (or should I say you) are very close to what I need.

    Thanks again,
    SKK
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Tweaked the approach again. Try this and let me know if it works properly.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    76
    Stephen,

    This is working great. I was just made aware late yesterday that our new financial software has a slightly different database structure but hopefully I should be able to tweek this guy from here.

    Again, thank you very much for your assistance. It's been greatly appreciated.

    Your friend,
    Steve Kipping

+ 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