+ Reply to Thread
Results 1 to 2 of 2

Hyperllink that populates the date and time on the target sheet in the correct cell

  1. #1
    Registered User
    Join Date
    06-21-2014
    Location
    London, England
    MS-Off Ver
    2010 Professional
    Posts
    16

    Hyperllink that populates the date and time on the target sheet in the correct cell

    Hi all,

    I have a question. I'm a bit of a noob when it comes to VBA etc but here goes:
    I am looking for a way to place a hyperlink on each tabbed sheet in an excel workbook so that when someone has read the info on that tab (it's a training document that I am designing) and hits the "YES" hyperlink it populate the date and time into the index sheet in the Yes column in the correct cell. Alternatively when he clicks "NO" it should then do the same but in the corresponding cell in the No column. Each time you press the hyperlink it will update the date and time.

    This will enable me to track when people have read and understood the training and I can address each person separately once I have a handle on what they know and what they don't know etc.
    Anyway, I have managed to get this far; I can get the Yes hyperlink to populate the date and time in the correct cell, OR I can get the No hyperlink to populate in its correct target cell. I can't get both to populate their corresponding cells. I have used the below (after trawling around looking for a solution). Is there any way to amend it so that it can do both?

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim rngWatch As Range

    'What cells do we care about?
    Set rngWatch = Range("F:F")


    'Don't care if user selects more than one cell
    If Target.Cells.Count > 1 Then Exit Sub
    'Is it a cell we care about?
    If Intersect(Target, rngWatch) Is Nothing Then Exit Sub

    'Place timestamp in cell next to our click
    Target.Offset(0, 1).Value = Now

    End Sub


    I have tried adding in the following after the Set rngWatch = Range("F:F")

    Set rngWatch = Range("H:H")

    but it doesn't work. Like I said, it will just do the one OR the other. If I click the Yes hyperlink it will take me back to the index Worksheet and populate the correct cell with date etc, and when I click the No hyperlink it also takes me back to the index Worksheet but does nothing else.

    Any ideas?

  2. #2
    Registered User
    Join Date
    06-21-2014
    Location
    London, England
    MS-Off Ver
    2010 Professional
    Posts
    16

    Re: Hyperllink that populates the date and time on the target sheet in the correct cell

    Duh. Now I feel really stupid.

    Changed Set rngWatch = Range("F:F") to Set rngWatch = Range("F:H")

    Works perfectly.

+ 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: 4
    Last Post: 08-20-2020, 12:49 PM
  2. Replies: 1
    Last Post: 06-14-2016, 10:25 AM
  3. Replies: 3
    Last Post: 04-12-2015, 04:01 PM
  4. Replies: 1
    Last Post: 04-11-2015, 02:16 AM
  5. [SOLVED] Insert Date/Time Stamp if Target Cell is Blank
    By howardjo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-12-2014, 07:13 AM
  6. Time Stamp when relevant value populates neighboring cell
    By Robertluckett in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-22-2013, 09:06 PM
  7. Replies: 5
    Last Post: 01-22-2013, 11:38 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