+ Reply to Thread
Results 1 to 7 of 7

Pulling the value of a specific cell based the date that I click

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Pulling the value of a specific cell based the date that I click

    Hi all!

    I'm hoping to get some guidance on an excel question that has me lost:

    In tracking my time worked, I would like to be able to click on a date in column 6, and then have the total hours worked on that date, shown on column 11, to be displayed in a new cell at the beginning of the worksheet. Is this at all possible? Ideally I would want to highlight multiple dates, and have a function that returns total hours worked in the cell at the beginning of the worksheet.

    Many thanks for your ideas!

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Pulling the value of a specific cell based the date that I click

    a sample file with desired result would be helpful
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Pulling the value of a specific cell based the date that I click

    Here is a PDF showing the excel file I am working with. I would want to be able to click on 6-Nov, for example, and then have the 9:30 from the "Hours worked" column in the same row be displayed in the first cell of the worksheet (Hours worked). Like I said, ideally I'd be able to highlight multiple cell dates, and have the sum returned in the fist cell of the worksheet (hours worked).

    Any guidance would be tremendous!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Pulling the value of a specific cell based the date that I click

    Ditto patel45's comment.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("F2:F" & ActiveSheet.UsedRange.Rows.Count + 1)) Is Nothing Then
        Target.Offset(, 5).Copy Range("A1")
    End If
    End Sub
    This will transfer data from Column K to A1 on selecting a cell in Column F. If that helps?

  5. #5
    Registered User
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Pulling the value of a specific cell based the date that I click

    Thanks for the code! I played around with it a bit but wasn't able to get the desired results (I'm next to macros so I'm probably doing something wrong!). I've attached a copy of the excel file I'm working with, with a comment on the spreadsheet explaining what I'm looking for. Any way you can work with this file?
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Pulling the value of a specific cell based the date that I click

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Intersect(Target, Range("F18:F" & ActiveSheet.UsedRange.Rows.Count + 1)) Is Nothing Then
         Range("F1") = Target.Offset(, 5).Value
    End If
    
    End Sub
    Put this code in Sheet1 module

  7. #7
    Registered User
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Pulling the value of a specific cell based the date that I click

    That's amazing, patel45! Did the trick beautifully.

    Thanks!

+ 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. Pulling a Specific Cell when Pulling a Tabel from Web Based Data
    By Zallen89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2013, 05:39 PM
  2. [SOLVED] Pulling whole row based on highest value of a specific supplier number
    By lunatyck in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-23-2012, 07:55 AM
  3. Web Based Queries - Pulling in only specific data??
    By andy8258 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2012, 08:24 AM
  4. Replies: 1
    Last Post: 12-14-2011, 11:32 PM
  5. Replies: 3
    Last Post: 09-22-2008, 11:36 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