適当に書くとこんな感じ
選択範囲のセルの'を外す
Sub ConvertToFormula
oSelection = ThisComponent.getCurrentSelection()
sData = oSelection.getFormulaArray()
For i = 0 to UBound(sData) step 1
For j = 0 to UBound(sData(i)) step 1
If InStr(sData(i)(j), "'") = 1 Then
sData(i)(j) = Mid(sData(i)(j), 2)
End If
Next
Next
oSelection.setFormulaArray(sData)
End Sub