【发布时间】:2017-04-13 17:16:12
【问题描述】:
我最近转而使用 LibreCalc 而不是 MS Excel。我有一些我想在 LibreCalc 中使用的 Excel 宏,其中一些使用 Application.InputBox 函数。我在 LibreCalc 中启用了 VBA 支持,但不幸的是,该功能无法识别。这是代码示例 -
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub Project_Data_Sort_By_Date()
Dim x As Long
Dim StartCont As Double
Dim EndCont As Double
Set R = Selection 'Select data range'
RowCnt = R.Rows.Count
colcnt = R.Columns.Count
Set TheTimes = Application.InputBox("Please enter time range: ", "User input", Type:=8) 'Times is corrected full data range of sample period'
在 MSExcel 中,type=8 的 Application.InputBox 函数会导致出现一个输入框,并允许用户在输入框中输入一系列单元格。使用通常的 Basic InputBox 功能,无法输入单元格范围。
因此,在 LibreCalc 中是否有等效的函数,或者是否有不同的方法可以手动选择一系列单元格并将其分配给参数,然后可以稍后在宏中调用?
【问题讨论】:
标签: excel basic libreoffice-calc vba