• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Copy a cell to another sheet by double clicking on it

How with VBA can you copy a cell to another sheet named "COPY" by double clicking on it . And put it in the first open cell of column a?
0
cd_morris
Asked:
cd_morris
  • 2
1 Solution
 
SiddharthRoutCommented:
Please paste this in the worksheet event.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim ws1 As Worksheet
    Dim ws1LastRow As Long
    
    Set ws1 = Sheets("Copy")
    ws1LastRow = ws1.Range("A" & Rows.Count).End(xlUp).Row + 1
    Target.Copy ws1.Range("A" & ws1LastRow)
End Sub

Open in new window


Sid
0
 
SiddharthRoutCommented:
Here is a sample

Sid
Book1.xls
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now