I don't understand anything about libreoffice BASIC language, but I need to run this macros from VBA to libreoffice. automatic converters do not work.
Help me rewrite this code!
Code: Select all
Private Sub ComboBox1_GotFocus()
With ActiveCell
Me.ComboBox1.Text = .Value
Me.ComboBox1.Top = Range("D1:D" & .Row - 1).Height + 0.75
End With
End Sub
Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then ActiveCell.Offset(0, 1).Select
If KeyCode = 27 Then Me.ComboBox1.Text = ActiveCell.Value
End Sub
Private Sub ComboBox1_LostFocus()
With Me.ComboBox1
.TopLeftCell.Value = .Text
If Len(.Text) > 0 Then Call AddFIO(.Text)
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Me.ComboBox1
If Target.Count > 1 Then
If Visible Then .Visible = False
Exit Sub
End If
If Not Intersect(.TopLeftCell, [D8:D200]) Is Nothing Then
If Len(.Text) > 0 And .Text <> .TopLeftCell.Text Then
.TopLeftCell.Value = .Text
If Len(.Text) > 0 Then Call AddFIO(.Text)
End If
End If
If Not Intersect(Target, [D8:D200]) Is Nothing Then
.Visible = True: .Activate
Else
If .Visible Then .Visible = False
End If
End With
End Sub
Private Sub AddFIO(Text As String)
If Application.WorksheetFunction.CountIf([FIO], Text) = 0 Then
Sheets("List").[A65536].End(xlUp).Offset(1, 0).Value = Text
Me.ComboBox1.ListFillRange = "FIO"
End If
End Sub