I want to click on a cell and have that cell automatically copy without
quot;right clicking and going to copyquot; so I can quickly paste it into a different
part of the same work sheet.
I also want to be able to quickly paste cell also in the same way into a
different part of the worksheet.
(IE List of names on the left side of worksheet, and on right side of
worksheet I want to be able to paste these names just by clicking from one
side to the other.)
What a coincidence that we should have the same question two hours apart.
Unfortuntely then, I can't help you. Hopefully someone can help us both.
Arkenor wrote:
gt;I want to click on a cell and have that cell automatically copy without
gt;quot;right clicking and going to copyquot; so I can quickly paste it into a different
gt;part of the same work sheet.
gt;
gt;I also want to be able to quickly paste cell also in the same way into a
gt;different part of the worksheet.
gt;
gt;(IE List of names on the left side of worksheet, and on right side of
gt;worksheet I want to be able to paste these names just by clicking from one
gt;side to the other.)
How about a double-click??
Take this macro and paste it into worksheet code (not a module):Public tick
Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
If tick = 0 Then
Selection.Copy Range(quot;Z100quot;)
tick = 1
Else
Range(quot;Z100quot;).Copy Selection
tick = 0
End If
End SubThis code makes use of a helper cell (Z100). Double-click the source and it
will copy, then double-click the destination and it will paste.
Just remember to put it in worksheet code.
--
Gary's Studentquot;Snow Dogquot; wrote:
gt; What a coincidence that we should have the same question two hours apart.
gt; Unfortuntely then, I can't help you. Hopefully someone can help us both.
gt;
gt; Arkenor wrote:
gt; gt;I want to click on a cell and have that cell automatically copy without
gt; gt;quot;right clicking and going to copyquot; so I can quickly paste it into a different
gt; gt;part of the same work sheet.
gt; gt;
gt; gt;I also want to be able to quickly paste cell also in the same way into a
gt; gt;different part of the worksheet.
gt; gt;
gt; gt;(IE List of names on the left side of worksheet, and on right side of
gt; gt;worksheet I want to be able to paste these names just by clicking from one
gt; gt;side to the other.)
gt;
OK, Thanks! I havn't tried it yet but thanks for the info.
Gary''s Student wrote:
gt;How about a double-click??
gt;
gt;Take this macro and paste it into worksheet code (not a module):
gt;
gt;Public tick
gt;Private Sub Worksheet_BeforeDoubleClick(ByVal _
gt; Target As Range, Cancel As Boolean)
gt;If tick = 0 Then
gt; Selection.Copy Range(quot;Z100quot;)
gt; tick = 1
gt;Else
gt; Range(quot;Z100quot;).Copy Selection
gt; tick = 0
gt;End If
gt;End Sub
gt;
gt;This code makes use of a helper cell (Z100). Double-click the source and it
gt;will copy, then double-click the destination and it will paste.
gt;
gt;Just remember to put it in worksheet code.
gt;gt; What a coincidence that we should have the same question two hours apart.
gt;gt; Unfortuntely then, I can't help you. Hopefully someone can help us both.
gt;[quoted text clipped - 9 lines]
gt;gt; gt;worksheet I want to be able to paste these names just by clicking from one
gt;gt; gt;side to the other.)
--
Message posted via OfficeKB.com
www.officekb.com/Uwe/Forums.a...excel/200603/1
After some hunting and pecking and my lack of knowledge of VBS this is what I
came up with.
The only thing I don't like is all the ElseIf Statements. Havn't figured
out how to do a range instead of a column. Going to work on that today.
***************
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 4 Then
Selection.COPY
ElseIf Target.Column = 7 Then
On Error Resume Next
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ElseIf Target.Column = 9 Then
On Error Resume Next
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ElseIf Target.Column = 10 Then
On Error Resume Next
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
End Sub
*********************
- Jul 20 Thu 2006 20:08
Copy cell on click
close
全站熱搜
留言列表
發表留言