How to change the next VBA script to the OpenOffice macro -
Code: Select all
On Error Resume Next
ThisWorkbook.Worksheets("Sheet2").Activate ' i know is it oSheet = thisComponent.Sheets (1) in OpenOffice
With ThisWorkbook.Sheets("Sheet2")
iLastrow = .Cells(Rows.Count, 5).End(xlUp).Row ' What are the analogs of this method?
a = Range(.[e3], .Range("E" & iLastrow)).Value
End With
With ThisWorkbook.Sheets("Sheet1")
iLastrow = .Cells(Rows.Count, 2).End(xlUp).Row
b = Range(.[j6], .Range("B" & iLastrow)).Value
End With
ReDim c(1 To UBound(a), 1 To 7)
With CreateObject("Scripting.Dictionary")
For i = 1 To UBound(b)
.Item(b(i, 1)) = i
Next
For i = 1 To UBound(a)
If .exists(a(i, 1)) Then
c(i, 1) = b(.Item(a(i, 1)), 5)
c(i, 3) = b(.Item(a(i, 1)), 6)
c(i, 4) = b(.Item(a(i, 1)), 8)
c(i, 5) = b(.Item(a(i, 1)), 4)
End If
Next
End With
With ThisWorkbook.Sheets("Sheet2")
.[f3].Resize(UBound(c), 5) = c
.Activate
End With