Hi.
I wonder if you can help me convert this Visual Basic code (Excel) into Basic so I can use the macro in LibreOffice Calc.
The VB code is as follows:
Option Explicit
Sub RowInsert()
Dim RwNo As Long
Dim Rw2In As Long
Application.ScreenUpdating = False
RwNo = InputBox("Row # below which to insert rows.", "Cell Name")
Rw2In = InputBox("No. of rows to insert.", "Rows")
Range("A" & RwNo + 1).Resize(Rw2In).EntireRow.Insert
'Range("F" & RwNo), Range("G" & RwNo), Range("H" & RwNo), Range("I" & RwNo), Range("0" & RwNo))).Copy
ActiveSheet.Range("B" & RwNo & ":B" & RwNo + Rw2In).Select
Selection.FillDown
ActiveSheet.Range("C" & RwNo & ":C" & RwNo + Rw2In).Select
Selection.FillDown
ActiveSheet.Range("J" & RwNo & ":J" & RwNo + Rw2In).Select
Selection.FillDown
ActiveSheet.Range("K" & RwNo & ":K" & RwNo + Rw2In).Select
Selection.FillDown
ActiveSheet.Range("L" & RwNo & ":L" & RwNo + Rw2In).Select
Selection.FillDown
ActiveSheet.Range("N" & RwNo & ":N" & RwNo + Rw2In).Select
Selection.FillDown
Application.CutCopyMode = False
Range("A" & RwNo).Select
Application.ScreenUpdating = True
End Sub
The macro is meant to be run in sheets where it is only possible to enter data in cells that are unlocked.
In order to avoid having to unprotect the sheet every time I want to insert a row between existing rows, I have this code that opens a dialogue box to eneter row no. and no. of rows to insert under the specified row no. A Keystroke combination is associated with the macro.
Thank you for your help.
Haagen