+ Reply to Thread
Results 1 to 3 of 3

how to copy on double-click the cell value to Clipboard

  1. #1
    cyrille
    Guest

    how to copy on double-click the cell value to Clipboard

    Hello everybody,
    My question is in the title... I just want to be able to automatically
    copy the text content of one selected cell (selected by double-click)
    into the Clipboard. Can you help me?
    I tried something like the following, but it doesn't work.
    Thanks in advance
    Cyril

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    Boolean)
    On Error Resume Next
    If ActiveCell.Value <> "" Then
    ActiveCell.Value.Copy
    End If
    Cancel = True
    End Sub

  2. #2
    Debra Dalgleish
    Guest

    Re: how to copy on double-click the cell value to Clipboard

    Copy, the cell, not the value:

    If Target.Value <> "" Then
    Target.Copy
    End If


    cyrille wrote:
    > Hello everybody,
    > My question is in the title... I just want to be able to automatically
    > copy the text content of one selected cell (selected by double-click)
    > into the Clipboard. Can you help me?
    > I tried something like the following, but it doesn't work.
    > Thanks in advance
    > Cyril
    >
    > Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    > Boolean)
    > On Error Resume Next
    > If ActiveCell.Value <> "" Then
    > ActiveCell.Value.Copy
    > End If
    > Cancel = True
    > End Sub



    --
    Debra Dalgleish
    Excel FAQ, Tips & Book List
    http://www.contextures.com/tiptech.html


  3. #3
    cyrille
    Guest

    Re: how to copy on double-click the cell value to Clipboard

    Thanks a lot...

    Debra Dalgleish wrote:
    > Copy, the cell, not the value:
    >
    > If Target.Value <> "" Then
    > Target.Copy
    > End If
    >
    >
    > cyrille wrote:
    >
    >> Hello everybody,
    >> My question is in the title... I just want to be able to automatically
    >> copy the text content of one selected cell (selected by double-click)
    >> into the Clipboard. Can you help me?
    >> I tried something like the following, but it doesn't work.
    >> Thanks in advance
    >> Cyril
    >>
    >> Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
    >> As Boolean)
    >> On Error Resume Next
    >> If ActiveCell.Value <> "" Then
    >> ActiveCell.Value.Copy
    >> End If
    >> Cancel = True
    >> End Sub

    >
    >
    >


+ 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