Relocating some of the rows while keeping original IDs in both sheets

Finally, I have managed to relocate certain rows from Sheet1 to Sheet2 (Zeile = Row).

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Zeile As Long
    Set Target = Intersect(Target, Range("J6:J1006"))
    If Target Is Nothing Then Exit Sub
    If Target = "C" Then
        Zeile = Target.Row
        Application.Union(Range(Cells(Zeile, 1), Cells(Zeile, 10)), _
        Range(Cells(Zeile, 13), Cells(Zeile, 16))).Copy _
        Destination:=Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    End If
End Sub

Now, there is another problem.

  • Send the email with datatable using Microsoft.Office.Interop.Excel
  • Finding Relevant Employee Rate in Excel using formula or PowerPivot
  • c# npoi excel How to get a cell's formula VALUE?
  • C# 2.0 Fastest way to parse Excel spreadsheet
  • Import file into microsoft access: field mapping
  • How to get row references from a formula VBA
  • In the first column of Sheet1, IDs for different projects are calculated based on the following formula:


    When relocating a certain row from Sheet1 to Sheet2, e.g. row 7, which has, according to the formula, ID number 2, it will have a different ID when being relocated to Sheet2 and the former row 8 in Sheet1, which will now be row 7 in Sheet1, will change its ID from 3 to 2.

    What I want to accomplish is that the IDs will always stay the same.

    I know that this could be accomplished by writing static values as ID numbers, but I am not allowed to do so. These formulas are mandatory.

    So: Is there any way to accomplish this?

  • Attempting to clear the values in two cells in a different workbook when I close the workbook. Run-time 91 error
  • Excel VBA to count and print distinct values
  • How to parse data from HTML and export in Excel in PHP
  • Add user defined function to Visual Studio Excel Add-in
  • Open Word template, paste Excel data in and save
  • Preserving features in xlsx file with python
  • MS Excel Spreadsheet is the best Office Software, Excel VBA and Excel Formulas make Spreadsheet work faster.