Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2011
    Posts
    5

    Exclamation Unanswered: retrieving value of clicked cell.

    Hi,

    I need to get the value present in the clicked cell into another cell..
    like suppose that in the below calendar

    June 2011
    S M T W Th F Sa
    1 2 3 4
    5 6 7 8 9 10 11
    12 13 14 15 16 17 18
    19 20 21 22 23 24 25
    26 27 28 29 30


    if clicked on day 15, then the value should be displayed in another cell like in D6, in the same way if clicked on day 25 then the value 25 should be displayed in D6, i mean on what ever value we click, it should be displayed in D6. If the solution for this problem is to have a macro is also fine...

    Please help me with this... Thanks in advance...
    Last edited by Steven_t; 06-20-11 at 10:43. Reason: dint get any replies...

  2. #2
    Join Date
    Feb 2004
    Location
    Swindon, UK
    Posts
    86
    if you build your calendar in cells A2 to G7 for example then add this code to the selection change event for that sheet it will show the clicked value in A1

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Row >= 3 And Target.Row <= 7 Then
    If Target.Column >= 1 And Target.Column <= 7 Then
    Range("A1").Value = Target.Value
    End If
    End If
    End Sub
    "Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •