Weeble
Board Regular
- Joined
- Nov 30, 2016
- Messages
- 95
- Office Version
- 365
So I am trying to paste information into a sheet.
When information is pasted i want this code to run.
But since they code is actualy changing in the workbook aswell, my guess is that it crashes it.
Is there any way to get around this?
When information is pasted i want this code to run.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)Dim emptyRow As Long
'Sätt fliken lager som aktiv
Worksheets("Uppföljning").Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("C:C")) + 1
On Error Resume Next
Cells(emptyRow, 6).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A1").Value
Cells(emptyRow, 11).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A2").Value
'Cells(emptyRow, 11).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A3").Value
'Cells(emptyRow, 11).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A4").Value
Cells(emptyRow, 5).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A5").Value
Cells(emptyRow, 8).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A6").Value
Cells(emptyRow, 7).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A7").Value
'Cells(emptyRow, 11).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A8").Value
Cells(emptyRow, 3).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A14").Value
Cells(emptyRow, 4).Value = ThisWorkbook.Worksheets("Mailklipp").Range("A15").Value
ThisWorkbook.Worksheets("Mailklipp").Range("A1:A15").Clear
ThisWorkbook.Worksheets("Mailklipp").Range("A1").Value = "Klipp in här"
ThisWorkbook.Worksheets("Mailklipp").Range("A1").Interior.Color = RGB(67, 152, 61)
End Sub
But since they code is actualy changing in the workbook aswell, my guess is that it crashes it.
Is there any way to get around this?