VBA code - create automatically a new row - does not work in LibreOffice [closed]
In MS-Excel I ‘m using a spreadsheet with a VBA-code (which I did not create myself) whereby automatically a row is created under the row where data is inserted when, in column B, I insert whether “i” or “u” (without the brackets). The code is :
Private Sub Worksheet_Change(ByVal Target As Range) Dim Rij As Integer, Kolom As Integer Dim Waarde As String Rij = Target.Row Kolom = Target.Column If Kolom = 2 Then Application.ScreenUpdating = False Waarde = UCase(Trim(Target.Value)) If Waarde = "I" Or Waarde = "U" Then Application.CutCopyMode = False Rows(Rij & ":" & Rij).Select Selection.Copy Selection.Insert Shift:=xlDown Rows(Rij + 1 & ":" & Rij + 1).Select Selection.PasteSpecial Paste:=xlPasteAllExceptBorders, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.ClearContents Range("C" & Rij).Select Application.CutCopyMode = True End If Application.ScreenUpdating = True End If
(Some translations because the code is in Dutch : Rij = Row / Kolom = Column / Waarde = Value)
The reason for this code :
- always leave two rows open/blank between the row where data is being inserted and the sum/total of the columns F and G
- lowering the sum/totals in F and G automatically so I don’t have to create a row manually (“Insert Row”) to maintain two open/blank rows.
In LibreOffice this VBA-code works almost. (first the security for macro’s has to be set to low via extra/libreoffice/security).
When I insert “i” or u” the new row is created underneath but all the inserted data (a date in column A and “i” or “u” in column B) is deleted.
I already mentioned this problem to the developers at Novel Gooo and the were about to fix it but then this project was discontinued.
For me solving this problem is absolutely necessary to abandon MS.
Does anyone has a solution ?