Hi all,

im hoping somebody may be able to help me on this macro?

basically im wanting to double click on a cell, then copy that to the top row, the top row is linked by a function to the row below. (which it does)

the vba should then open the 2nd workbook (which it does)

the macro then finds an empty column (however it is counting for the first worksheet not the second)

it then pastes the data into place. (which is currently the wrong place)

Thanks for any help

Charlie

Code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    
Cancel = True

ActiveCell.EntireRow.Copy
Cells(1, 1).Select
ActiveCell.EntireRow.Select
ActiveCell.EntireRow.PasteSpecial

Cells(2, 1).Select
ActiveCell.EntireRow.Copy

Workbooks.Open ("C:\Users\ccreswell\Desktop\Sample Inspection Report index.xls")
Workbooks("sample inspection report index.xls").Activate

'find empty column
Dim columnempty As Range
Set columnempty = Range("C:C")
Dim c As Range
Dim i As Long
i = 1
For Each c In Workbooks("sample inspection report index.xls").columnempty.Cells
    If c.Value2 = "" Then Exit For
    i = i + 1
Next c
  
ActiveSheet.Cells(i, 1).Select
ActiveCell.EntireRow.Select
ActiveCell.EntireRow.PasteSpecial


End Sub