The following module works in Excel and it works in the Excel Spreadsheet uploaded into LibreOffice. It does not work when copied to a Spreadsheet created in LibreOffice Calc.
I get an error message “BASIC runtime error.
‘35’
Sub-procedure or function procedure not defined.
Additional information: Sheets”.
What needs changed to make this work?
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub Macro1()
'
' Macro1 Macro
'
'
Dim I As Integer ' Loop Counter
Dim X As Integer ' Number of times to Loop
Sheets("Home").Select
Range("E4").Select
X = ActiveCell.Value
' MsgBox (X)
For I = 1 To X
Range("I20").Select
' ActiveCell.FormulaR1C1 = "1"
ActiveCell.Value = I
ActiveSheet.Calculate
Range("B17:G17").Select
Selection.Copy
Sheets(ComboResults).Select
If I = 1 Then Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Range("C3").Select
Selection.Offset(1, 0).Select
Sheets(Home).Select
Next I
End Sub