https://bugs.freedesktop.org/show_bug.cgi?id=58849

          Priority: medium
            Bug ID: 58849
          Assignee: [email protected]
           Summary: Macros: VBA code - create automatically a new row -
                    does not work in LibreOffice
          Severity: normal
    Classification: Unclassified
                OS: Windows (All)
          Reporter: [email protected]
          Hardware: Other
        Whiteboard: BSA
            Status: UNCONFIRMED
           Version: 3.6.4.3 release
         Component: BASIC
           Product: LibreOffice

Created attachment 72233
  --> https://bugs.freedesktop.org/attachment.cgi?id=72233&action=edit
the spreadsheet with the VBA-code

Problem description: 
Hi

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 ?

Thx
Steps to reproduce:
1. ....
2. ....
3. ....

Current behavior:

Expected behavior:


Operating System: Windows XP
Version: 3.6.4.3 release

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to