+ Reply to Thread
Results 1 to 6 of 6

Need Macro for finding date in cell and adding data

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Need Macro for finding date in cell and adding data

    Hi There,

    I'm attempting to write a macro that finds an exact date in a cell in another worksheet then adds data from a Text Box to a cell 1 Row below. So far I've gotten it to find and select the cell using the following code:

    Please Login or Register  to view this content.
    But I the date needs to be todays date vs. a set date.

    any help would be appreciated
    Last edited by evilr34; 03-13-2013 at 02:48 PM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Need Macro for finding date in cell and adding data

    Need more information.

    1. Where is this text box located? What is it's name?
    2. 1 Row below what? The found cell?
    3. Do you only want to be searching a specific range or the whole entire used range?

    FWIW:

    Please Login or Register  to view this content.
    Last edited by stnkynts; 03-13-2013 at 05:15 PM.

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need Macro for finding date in cell and adding data

    [QUOTE=stnkynts;3157661]Need more information.

    1. Where is this text box located? What is it's name?

    -Text Box is Located on sheet1, It's name is TextBox1. The data that needs to be searched is located on sheet2

    2. 1 Row below what? The found cell?

    -Yes, below the found cell

    3. Do you only want to be searching a specific range or the whole entire used range?

    -the entire sheet

    Basically I'm creating a labour tracking sheet. On Sheet1, I have the names and beside them I have a textbox for hour(s) entry. On sheet2 I have a time card with the names and a calender for the month with the dates across the top and below I'm trying to track their hours.

    Example Below:

    capture2.png

    capture.png
    Last edited by evilr34; 03-14-2013 at 09:52 AM.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Need Macro for finding date in cell and adding data

    Based upon your pictures you might want to make your dates the same format. Did you try the above code? Also, how do the names play into this. Personally I think you are approaching the problem wrong. A userform might be most appropriate. You could set it up many different ways. (example: You can have the employees log their time themselves)
    Last edited by stnkynts; 03-14-2013 at 12:28 PM.

  5. #5
    Registered User
    Join Date
    03-08-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need Macro for finding date in cell and adding data

    Ok I've reversed the Date (thanks for noticing that) and tryed your Code. It runs, but doesn't seem to accomplish anything.

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Need Macro for finding date in cell and adding data

    It probably didn't work for you because may not have had values in column A of sheet2 (which I initially based the range determination off of). I tweaked it slightly so it might work for your application. I tested it on a workbook with the limited information you provided and it worked for me.

    Please Login or Register  to view this content.
    Note: You indicated it only needs to go 1 row below the found date. If you are going to try to edit this for each employee name you will probably have to adjust the offset to match.
    Last edited by stnkynts; 03-15-2013 at 11:19 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